This is old now but i have had success prepending it in my command line. as in:
powershell.exe -noprofile set-executionpolicy remotesigned -force;.\MyScript.ps1; exit $LASTEXITCODE
this sets the exec policy, runs the script and returns the LASTEXITCODE to sccm.
3 replies
Important Information
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.