Hi all,
MDT 8456 with 2004 patch, running a task sequence with a powershell script - even if that script fails, a return code of "0" is still returned to the TS.
If the script fails, i need the TS to fail..
From the logs
<![LOG[File \server\MDT4\Scripts\Custom\DeviceCompat\CheckCompat.ps1 cannot be loaded.
The file \server\MDT4\Scripts\Custom\DeviceCompat\CheckCompat.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.\]LOG\]!>\<time="18:38:58.000+000" date="11-03-2020" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[At line:1 char:3
- . "\server\MDT4\Scripts\Custom\DeviceCompat\CheckCompat.ps1
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]LOG]!><time="18:38:58.000+000" date="11-03-2020" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[SecurityError: (:) [], PSSecurityException]LOG]!><time="18:38:58.000+000" date="11-03-2020" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[TSHOST: Script completed with return code 0]LOG]!><time="18:38:58.000+000" date="11-03-2020" component="TaskSequencePSHost" context="" type="1" thread="" file="TaskSequencePSHost">
Im a bit baffled as to why this is returning an error code of 0 when it cannot run due to signing restrictions!
Continue on error is not selected for this step.