Windows Updates: 1 Discovering Updates
I want to spend a few posts looking at Windows updates. There is a COM object model that enables us to work with the updates system.
Any update processing starts with discovering the updates that are available
| 001 002 003 004 005 006 007 008
| function get-update { $session = New-Object -ComObject Microsoft.Update.Session $searcher = $session.CreateUpdateSearcher() $result = $searcher.Search("IsInstalled=0 and Type='Software'" ) $result.Updates | select Title, IsHidden } |
Create an object representing an update session
Create an update searcher and search for software updates that aren’t installed.
We can then output the update title and if its hidden or not. Other properties are available.