Finding Installed Updates (and searching for missing) (Part 1)

by Aug 2, 2017

Windows can automatically determine the updates that may be missing on your system, provided you have an Internet connection. PowerShell can use the same system interfaces to query this information. The code below returns information about all updates installed on your system:

#requires -Version 2.0

$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$updates = $Searcher.Search("IsInstalled=1").Updates 

$updates |
  Select-Object Title, LastDeployment*, Description, SupportUrl, MsrcSeverity |
  Out-GridView

To see the updates you are actually missing, change “IsInstalled=1” to “IsInstalled=0”:

#requires -Version 2.0

$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$updates = $Searcher.Search("IsInstalled=0").Updates 

$updates |
  Select-Object Title, LastDeployment*, Description, SupportUrl, MsrcSeverity |
  Out-GridView

Twitter This Tip! ReTweet this Tip!