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.

Answer Summary:
0 Comments   [ + ] Show Comments


Please log in to comment

Answer Chosen by the Author

Your deployment tool/script needs to trap return code 2359302 and accept it as a success, I have a feeling your letting KACE deal with it and 2359302 is defo not a standard im OK return code...

Wrap the WMF whatever you call it in a batch/powershell/vbs/whatever capture the return code, and if equals 2359302 then eject from batch/powershell/vbs/whatever with a 0 - all ok! 

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%

exit /b 0
Answered 07/19/2016 by: rileyz
Red Belt

  • Not being a programmer, can you elaborate on how to make a batch file capture the return code?
    start /wait installposh.bat ???
    • Called support on an unrelated issue and asked about this. His recommendation was this:
    • 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.
      • 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.
      • 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.
Please log in to comment


Answer this question or Comment on this question for clarity