none
Probleme mit Powershell unter Windows XP sp3 keine ClassFactory eingetragen... RRS feed

  • Allgemeine Diskussion

  • hallo zusammen habe dieses klasse Script im Internt gefunden es ermittelt dienoch fehlenden updates


    function Global:func_run_WindowsUpdate
    {param ($Criteria="IsInstalled=0 and Type='Software'" , [switch]$AutoRestart,
    [switch]$ShutdownAfterUpdate)
    $resultcode= @{0="Not Started"; 1="In Progress"; 2="Succeeded"; 3="Succeeded With Errors"; 4="Failed" ; 5="Aborted" }

    # $debuglevel = 1
    # Snapshot - Wieviel Patchs sind installiert
    # $hotfixcounter_first = Get-HotFix

    $updateSession = new-object -com "Microsoft.Update.Session"
    write-progress -Activity "Updating" -Status "Checking available updates"
    # Debug Info
    # if ( $debuglevel -gt 0){$strInfo = "Updating: Checking available updates"; func_send_screen_output $strinfo 1}

    $updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates

    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

    ich hoffe Ihre könnt mir helfen
     Greets bitworker
    Mittwoch, 4. November 2009 22:00