When I run a powershell script from the DS 6.9 SP6, either inline using the #powershell designation or from an external ps1 script, it complains that "powershell execution policy is restricted".
So using group policy I set computer->Administrative templates->Windows Components->Windows PowerShell->Turn on Script Execution-> Allow all scripts. If I use get-executionpolicy -list on the client computers, it shows the following.
- MachinePolicy Unrestricted
- User Policy Undefined
- Process Undefined
- CurrentUser Undefined
- LocalMachine Undefined
If I manually set the LocalMachine policy to Unrestricted, the DS can run the powershell script. However, there doesn't seem to be a GP method of changing the LocalMachine policy. The Microsoft documentation says the exact opposite in that the MachinePolicy from GP should take precidence over all ther others. Do they have a coding bug?
Anyone know how to set this globally or allow DS to run powershell scripts without using a cmd script to call a powershell script?