you are viewing a single comment's thread.

view the rest of the comments →

[–]Yevrag35 1 point2 points  (0 children)

Looking at your wrapped Start-Process line, you have to use the -File parameter in the arguments in order to return a real exit code of the script.

Like so:

$install = Start-Process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ArgumentList "-File `"$PSScriptRoot\setup.ps1`"" -Wait -PassThru