PowerShell says “execution of scripts is disabled on this system.”

前端 未结 30 2474
傲寒
傲寒 2020-11-22 00:45

I am trying to run a cmd file that calls a PowerShell script from cmd.exe, but I am getting this error:

Management_Instal

30条回答
  •  臣服心动
    2020-11-22 01:14

    If you're using Windows Server 2008 R2 then there is an x64 and x86 version of PowerShell both of which have to have their execution policies set. Did you set the execution policy on both hosts?

    As an Administrator, you can set the execution policy by typing this into your PowerShell window:

    Set-ExecutionPolicy RemoteSigned
    

    For more information, see Using the Set-ExecutionPolicy Cmdlet.

    When you are done, you can set the policy back to its default value with:

    Set-ExecutionPolicy Restricted
    

提交回复
热议问题