if ($Updates.Count -eq 0) { "There are no applicable updates."} else { $downloader = $updateSession.CreateUpdateDownloader() $downloader.Updates = $Updates
$Updates | select-object Title $anzahlupdates = $Updates.Count
$anzahlupdates
# Wie viele HotFixes sind Installiert worden # $hotfixcounter_second = Get-HotFix
# Ist ein Reboot notwendig?
} } func_run_WindowsUpdate
Habe es für meine Bedürfnisse angepasst Unter Windows Vista business 32 Bit powershell v2 ctp3 läuft das Script unter Windows XP sp3 Pwershell v2 ctp3 erhalte ich folgenden Fehler und komm nicht mehr weiter
POWERSHELL EXCEPTION EXCEPTION TYPE:System.Management.Automation.MethodInvocationException MESSAGE:Exception calling "Search" with "1" argument(s): "Anwendung wurde gestartet, aber es wurde keine ClassFactory eingetragen. (Exception from HRESULT: 0x800401FE (CO_E_APPDIDNTREG))" POSITION: At line:15 char:54 + $updates=$updateSession.CreateupdateSearcher().Search <<<< ($Criteria).updates