installing Windows Management Framework 5 (PowerShell 5) as post installation task
Trying to install PowerShell 5 to Windows 7 scripted install. It has 2 dependencies, .net4.5 and WMF4 (powershell4)
I have the .net4.5.2 install working fine
I set the WMF4 install task to Windows6.1-KB2819745-x64-MultiPkg.msu /quiet /log:%temp%\posh4install.log (I also tried PoSH4-Windows6.1-KB2819745-x64-MultiPkg.msu /quiet /forcereboot)
When running the scripted install, it shows that it is running the WMF4 task, reboots, then shows that it is running the WMF4 package. It then fails with return code 2359302 which is pretty well documented online as occurring because the package is already installed. I can confirm that it has version 4 of Powershell by launching Powershell and running $PSVersionTable.
If I tell it to continue, it follows the same steps for WMF5.0. I can then confirm that PowerShell 5 is installed because $PSVersionTable shows version 5. I then continue and the rest of the scripted install runs with no problems.
Not sure how to eliminate the error so it continues without the errors.
Answers (1)
Top Answer
Your.msu /quiet /norestart
if %errorlevel% equ 0 goto EXITOK
if %errorlevel% equ 1641 goto EXITOK
if %errorlevel% equ 1707 goto EXITOK
if %errorlevel% equ 3010 goto EXITOK
exit /b %errorlevel%
:EXITOK
exit /b 0
Comments:
-
Not being a programmer, can you elaborate on how to make a batch file capture the return code?
start /wait installposh.bat ??? - crwdawg 8 years ago-
Called support on an unrelated issue and asked about this. His recommendation was this:
https://support.software.dell.com/k2000-systems-deployment-appliance/kb/128917 - crwdawg 8 years ago -
Dell's solution is a cop out, what happens if it fails? you'll never capture it.
I've updated my answer, hope it help. - rileyz 8 years ago-
I thought it was seriously lacking too, but pending any more info, it resolved the problem. Thanks for going back and updating the answer. It is much better and ,like you said, will let me know if it actually failed. - crwdawg 8 years ago
-
No worries, glad it helps.
Might pay to read up on the msi exit codes, some of them you might want to pass back to SCCM, like 3010, then sccm will know it requires a reboot etc. - rileyz 8 years ago