Powershell

Powershell

Postby aker » 25.03.2012, 13:00

Die Powershell benötigt zur Installation ja das .NET Framework.
Wenn die DoUpdate.cmd jedoch manuell mit dem Parameter "/instpsh" aufgerufen wird, versucht WSUSOU die Powershell zu instllieren, ohne vorher zu prüfen, ob .NET installiert ist.
Notiz: Powershell 1.0 erforderte .NET 2.0, daraus schlussfolgere ich, dass Version 2.0 eine neure Version erfordert. (vermutl. 3.0 oder 3.5)
Ich werde dies natürlich noch prüfen.
[edit]Habe es mitlerweile gerüft. PSH 2.0 benötigt .NET 2.0 SP1.[/edit]
Dort sollte ein Code eingebracht werden, der die Installation von .NET prüft.
z.B.
Code: Select all
rem *** Install Windows PowerShell 2.0 ***
if "%INSTALL_PSH%" NEQ "/instpsh" goto SkipPShInst
if %DOTNET35_VER_MAJOR% lss 2 (
    if "%INSTALL_DOTNET35%"="" (
        goto SkipPShInst
    )
)
echo Checking Windows PowerShell 2.0 installation state...
if %PSH_VER_MAJOR% LSS %PSH_VER_TARGET_MAJOR% goto InstallPSh
if %PSH_VER_MAJOR% GTR %PSH_VER_TARGET_MAJOR% goto SkipPShInst
if %PSH_VER_MINOR% LSS %PSH_VER_TARGET_MINOR% goto InstallPSh
if %PSH_VER_MINOR% GEQ %PSH_VER_TARGET_MINOR% goto SkipPShInst
:InstallPSh
if "%PSH_TARGET_ID%"=="" (
  echo Warning: Environment variable PSH_TARGET_ID not set.
  echo %DATE% %TIME% - Warning: Environment variable PSH_TARGET_ID not set >>%UPDATE_LOGFILE%
  goto SkipPShInst
)
echo %PSH_TARGET_ID%>"%TEMP%\MissingUpdateIds.txt"
call ListUpdatesToInstall.cmd /excludestatics /ignoreblacklist
if errorlevel 1 goto ListError
if exist "%TEMP%\UpdatesToInstall.txt" (
  echo Installing Windows PowerShell 2.0...
  call InstallListedUpdates.cmd /selectoptions %BACKUP_MODE% %VERIFY_MODE% /errorsaswarnings
) else (
  echo Warning: Windows PowerShell 2.0 installation file ^(kb%PSH_TARGET_ID%^) not found.
  echo %DATE% %TIME% - Warning: Windows PowerShell 2.0 installation file ^(kb%PSH_TARGET_ID%^) not found >>%UPDATE_LOGFILE%
  goto SkipPShInst
)
set REBOOT_REQUIRED=1
:SkipPShInst


Viele Grüsse
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32

Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 55 guests

cron