When you want to examine installed updates on your machine, rather than searching for updates online and then comparing the installation status with your locally installed updates, a much faster approach queries the local update history.
The code below returns all updates present on your machine. It does not need an online connection.
#requires -Version 2.0 $Session = New-Object -ComObject "Microsoft.Update.Session" $Searcher = $Session.CreateUpdateSearcher() $historyCount = $Searcher.GetTotalHistoryCount() $status = @{ Name="Operation" Expression= { switch($_.operation) { 1 {"Installation"} 2 {"Uninstallation"} 3 {"Other"} } } } $Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date, $status | Out-GridView