I am connecting to WSUS and searching for updates just fine. This works as expected
#Connect to the WSUS 3.0 interface.
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$WsusServerAdminProxy = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($WsusServer,$UseSSL,$PortNumber);
I can Search for an Update just fine using this:
$KBs = $WsusServerAdminProxy.SearchUpdates($KB123456) | ?{-not $_.IsDeclined}
If KB123456 exist, then $KBS returns a list, and I can select Titles.
What I want to know, is, if KB123456 does not return any results, how can I flag it? Some sort of output line like :
If ($kbs -eq $null)
{
$kbs | export-csv -append d:\NullUpdates.csv
}
The problem is, that does not work. I guess its not returning $Null, but not returning anything.
Help Please