使用ExecutionPolicy ByPass启动Powershell脚本,但不起作用

时间:2019-07-18 09:15:22

标签: powershell powershell-2.0

我试图在执行策略受到限制的计算机上运行ps脚本。

我无法更改此策略,因此我试图以这种方式运行脚本:

.\Script.ps1 -ExecutionPolicy ByPass

但是我仍然收到错误消息:

  

无法加载,因为此系统上禁用了脚本执行

系统是带有PowerShell 2.0的Windows Server 2008 R2

编辑:

Get-ExecutionPolicy -List
          Scope                                             ExecutionPolicy
          -----                                             ---------------
  MachinePolicy                                                   Undefined
     UserPolicy                                                   Undefined
        Process                                                   Undefined
    CurrentUser                                                   Undefined
   LocalMachine                                                   Undefined

0 个答案:

没有答案
相关问题