24 April 2013

Windows HotFix management with PowerShell

Checking if a particular hotfix / update / patch  is installed is often an important post-build check.  With non GUI Windows server deployments you can use the following command lines to get the info you want.

Install from the command line
You can individually download and install windows updates by KB number.  Simply go to download.microsoft.com and search for the KB number.  Once downloaded you can use the Windows Update Standaline Installer to install the update.

wusa .\Windows8-RT-KB2822241-x64.msu /quiet


Retrieving list of installed updates
To get a full list of installed hotfixes run

get-hotfix




Get info on specific KB

Get-HotFix -id KB2803676

If you are looking for a specific few updates you can use a variable

$numbers = "KB2770917","KB2779768"
Get-HotFix -id $numbers

If you want to check for updates installed after a specified date

Get-HotFix | ? installedon -gt 2013/04/01

*Thank to Windows Scripting guy

Alternative commands

There are of course a few other toold that can give you a list of hotfixes but they
You can query the WMI with wmic

wmic qfe list


Our you can run good old systeminfo

systeminfo




No comments:

Post a Comment