Listing Windows Updates with PowerShell

by Sep 27, 2012

There is a not widely known COM object that you can use to list all the installed Windows Updates on a machine. Here is the code:

$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$HistoryCount = $Searcher.GetTotalHistoryCount()
$Searcher.QueryHistory(1,$HistoryCount) | 
  Select-Object Date, Title, Description

Twitter This Tip! ReTweet this Tip!