0

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?

Pickle
  • 91
  • 1
  • 3
  • 10

1 Answers1

0

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)
Pickle
  • 91
  • 1
  • 3
  • 10