Execution of a Powershell script fails with "Exit code 1 indicates possible error [SDM228001]"

Document ID : KB000048314
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Execution of a Powershell script fails with "Exit code 1 indicates possible error [SDM228001]"

The output of the execution as seen in the Job Output tab shows the following error:

Z:\activate\8302AF75-1B39-4D97-8737-B4F505082305.itm\1.vol>powershell .\myscript.ps1
File Z:\activate\8302AF75-1B39-4D97-8737-B4F505082305.itm\1.vol\myscript.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:15
+ .\myscript.ps1<<<<
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException

Solution:

Adding the following security setting before the call to the script will allow the execution:

powershell Set-ExecutionPolicy -Scope LocalMachine Unrestricted -force