Re: get-hotfix script

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: Re: GPO to disable simple file sharing in Windows XP
    ... > script at logon. ... GPO to show file extensions. ... if you know the registry path you can create your own ADM to ... Visit Topic URL to contact author (reg. ...
    (microsoft.public.win2000.group_policy)
  • Re: Navigating The Registry
    ... On 2/1/2005 11:00 AM On a whim, Ramesh, MS-MVP pounded out on the keyboard ... > Dim MyKey ... type the full registry path in the Input box (Example: ... I just tried the script and it gave an error message: ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Navigating The Registry
    ... On 2/1/2005 11:00 AM On a whim, Ramesh, MS-MVP pounded out on the keyboard ... > Dim MyKey ... type the full registry path in the Input box (Example: ... I just tried the script and it gave an error message: ...
    (microsoft.public.windowsxp.general)
  • Re: WMI: Win32_Product - Does not return all products
    ... Try enumerating from this registry path: ... Torgeir Bakken is frequently posting a script ... HTH, ...
    (microsoft.public.windowsxp.wmi)