Using the PSWindowsUpdate module to interrogate Windows Update

The Install-WindowsUpdate cmdlet is pretty comprehensive!

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!

About Rob

I've been interested in computing since the day my Dad purchased his first business PC (an Amstrad PC 1640 for anyone interested) which introduced me to MS-DOS batch programming and BASIC.

My skillset has matured somewhat since then, which you'll probably see from the posts here. You can read a bit more about me on the about page of the site, or check out some of the other posts on my areas of interest.

No Comments

Add a Comment