Using the PSWindowsUpdate module to interrogate Windows Update
I've been looking at automating the patching of some servers that aren't domain joined, and one of the tools that I've spotted that may come in handy is the PSWindowsUpdate module. Once it's installed, you can query the status of the local machine with commands like:
Get-WindowsUpdate -KBArticleID KB4483235 -IsInstalled
That command checks to see whether the local machine has the 2018-12 Cumulative Update for Windows 10 (1809) installed, but you can substitute in other KB article IDs, or even drop that parameter to get a list of all the updates that have been installed. The full list does appear to exclude superceded updates though as the Settings app is showing that the machine I'm using has 50 Quality Updates installed and 2 Other Updates, whereas running this:
(Get-WindowsUpdate -IsInstalled).Count
Returns a count of 32 rather than 52.
Hopefully I'll find the time and opportunity to dig into this more and put together a more detailed post when I've actually made some productive use of it. If anyone else out there is looking for Windows Update manipulation via PowerShell, this does look like a good start!