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.

Published Fri, Jun 10 2011 19:59 by RichardSiddaway
Filed under: ,

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: