#powershell Get a List of Windows Update Hotfixes & Patches

To retrieve a comprehensive list of installed quick fix engineering hotfixes and patches[1] in Windows Update, you export into a format such as CSV with the help of the perennial $env:windir\Windows\System32\Wbem\WMIC.exe tool:

$file = “qfe.csv”
wmic qfe list full /format:csv > $file
#optionally run in MS-DOS
#wmic qfe list full /format:”%windir%\system32\wbem\en-us\csv.xsl” > “qfe.csv”

Subsequently, you can import the Comma Separated Variable file and… … process it according to your administrative needs:

cat $file | ? { $_ } | Out-File “$($file).csv” -Encoding utf8
$qfe = Import-Csv “$($file).csv” -Delimiter “,”

$qfe | select -Property *,@{l=’InstalledOn’;e={[Datetime]$_.InstalledOn}} -ExcludeProperty InstalledOn |
sort InstalledOn | ogv -Title ( (hostname) + ” hotfixes/patches ($($qfe.count))” )
#ft -Property HotFixID,InstalledOn,Caption,Description,status -au

[1] Windows-only qfe hotfixes and patches i.e. excludes applications like Microsoft Office, Skype, etc.

Leave a Reply