Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Updates = @()
- $Session = New-Object -ComObject Microsoft.Update.Session
- $UpdateServiceManager = New-Object -ComObject Microsoft.Update.ServiceManager
- $UpdateService = $UpdateServiceManager.AddScanPackageService("Offline Sync Service", "C:\Users\Vadim\Downloads\wsusscn2.cab", 1)
- $Searcher = $Session.CreateUpdateSearcher()
- $Searcher.ServerSelection = 3
- $Searcher.ServiceID = [string]$UpdateService.ServiceID
- $updates = $Searcher.Search("IsInstalled=0 and IsHidden=0")
- foreach ($update in $updates.Updates) {
- Write-Host $update.Title
- }
Add Comment
Please, Sign In to add comment