I have a package that points to a Powershell script which runs the installation steps. The script fails and returns 1; however, SCCM shows the deployment was successful.
How do I get SCCM to recognize that the script returned an error code?
I have a package that points to a Powershell script which runs the installation steps. The script fails and returns 1; however, SCCM shows the deployment was successful.
How do I get SCCM to recognize that the script returned an error code?
Figured it out. Added [System.Environment] to the end of the script
$installresult = (Start-Process cmd.exe -ArgumentList "/c $PSScriptRoot\Configuration\PostConfig.cmd" -Wait -PassThru).ExitCode
[System.Environment]::Exit($installresult)