Stupid PowerShell snippet of the week – List Installed Windows Updates.
OK, so this isn’t strictly SharePoint, but I have been bitten a few times lately by Microsoft patches, particularly those of the .NET variety. In both cases there were 2 problems that came up.
- Looking through a list of updates by the KBXXXXXXXX number is difficult in the Windows Update GUI
- There are a lot of updates, which makes it difficult to compare what is installed on two different machines.
My answer? It isn’t exactly a quantum leap in PowerShell technology, but it is a script to list the installed Windows updates and the output can be easily directed to a text file so you can search it easily in notepad or compare it to the output from another machine.
$wu = new-object -com "Microsoft.Update.Searcher" $updatecount = $wu.GetTotalHistoryCount() $wu.QueryHistory(0,$updatecount)|select title
( add |out-file updatelist.txt right after select title to dump all of the output into a text file for easy comparison.)
I hope this is a helpful snippet in your time of troubleshooting need!