Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

后端 未结 13 1001
自闭症患者
自闭症患者 2021-01-30 02:35

Since this question continues to attract responses that are either refuted by the question body or don\'t address the actual problem, please read th

13条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 03:34

    Some things to check:

    Can you change to unrestricted?

    Set-ExecutionPolicy Unrestricted
    

    Is the group policy set?

    • Computer Configuration\Administrative Templates\Windows Components\Windows PowerShell
    • User Configuration\Administrative Templates\Windows Components\Windows PowerShell

    Also, how are you calling Script.ps1?

    Does this allow it to run?

    powershell.exe -executionpolicy bypass -file .\Script.ps1
    

提交回复
热议问题