Powershell没有';即使在设置了执行策略之后也不能运行脚本

Powershell没有';即使在设置了执行策略之后也不能运行脚本,powershell,virtualenv,Powershell,Virtualenv,我正在尝试运行virtualenv脚本,以便在powershell上使用以下命令激活它: .\env\Scripts\activate.ps1 但我得到了这个错误: .\env\Scripts\activate.ps1 : File C:\Users\user\Desktop\tranning\env\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this system. For mo

我正在尝试运行virtualenv脚本,以便在powershell上使用以下命令激活它:

.\env\Scripts\activate.ps1
但我得到了这个错误:

.\env\Scripts\activate.ps1 : File C:\Users\user\Desktop\tranning\env\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this 
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\env\Scripts\activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
我阅读了这篇文章,试图通过以管理员身份运行powershell并键入以下命令来解决此问题:

Set-ExecutionPolicy RemoteSigned 

但不幸的是,一切都没有改变

根据前面提出的问题,您还可以尝试其他一些方法:

要从链接中总结:

  • 如果从windows服务器运行,请确保在系统上所有版本的powershell(均为x64 x86版本的powershell)上设置执行策略
  • 运行以下操作以绕过执行策略:

  • powershell-ExecutionPolicy ByPass-File script.ps1

    运行
    Set ExecutionPolicy RemoteSigned
    后,您收到了什么消息?你试过无限制的吗?我一无所获。是的,我这样做了,我收到了以下消息:Set ExecutionPolicy:PowerShell成功地更新了您的执行策略,但该设置被在更特定范围内定义的策略覆盖。由于重写,shell将保留其当前有效的RemoteSigned执行策略。键入“Get ExecutionPolicy-List”以查看执行策略设置。有关更多信息,请参阅“获取帮助设置执行策略”。@AmirMakram只是想确认一下,您是本地/域管理员,并且您也是以管理员身份运行PS/ISE吗?@Matthew yes我知道该网站还有十几种规避执行策略的其他方法。我会检查的