Hi team need help on exit codes. I have a script that returns pass if all the conditions are passed . returns fail if one of the condition is fail.
if((alltest) -eq 'Pass')
Out-File -FilePath $SucessOutfile
$global:ExitCode = 0
Out-File -FilePath $FailureOutfile
$global:ExitCode = 1 #Set the exit code for the Packager
works fine when working with powershell ISE but when run with SCCM it will return always 0 even those the condition as return 1