Re: get-hotfix script
- From: Chris Warwick <news@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 Jan 2006 22:29:49 +0000
On 19 Jan 2006 15:29:43 -0800, "Tom G." <Tom.Glowacki@xxxxxxxxxxx>
wrote:
>
>James Truher [MSFT] wrote:
>> a long time ago, I wrote a script that returned information about the
>> installed hotfixes. At the time, I used hashtables, but I've rewritten it
>> to use add-member. Here you go!
>>
>><SNIP>
>
>I like the idea of this script. However, when I tried running it
>exactly as shown above, I ran into some problems. It seems just about
>anywhere you use the variable $p in the inner foreach loop, it was
>necessary to add the $BASE variable in front of it. Otherwise the
>get-childitem cmdlet tried to resolve the $p variable to a file system
>path rather than a registry path. I've included the edited script
>below.
>
<SNIP>
Cool! I still get errors though... I'm guessing the guys who write
hotfixes always use American style dates (mm/dd/yy) whereas my
[datetime] cast is expecting uk format (dd/mm/yy) - so I get:
Cannot convert "12/15/2004" to "System.DateTime". Error: "String was
not recognized as a valid DateTime."
At C:\MSH\get-hotfix.msh:49 char:61
+ $idate = [datetime](get-property "$BASE/$p/$patch").I <<<<
nstalledDate
.
- References:
- get-hotfix script
- From: James Truher [MSFT]
- Re: get-hotfix script
- From: Tom G.
- get-hotfix script
- Prev by Date: Re: $input variable inside a function
- Next by Date: Re: [MSH] MSH Not So Great For Interactive Users
- Previous by thread: Re: get-hotfix script
- Next by thread: [MSH] MSH Not So Great For Interactive Users
- Index(es):
Relevant Pages
|