相关疑难解决方法(0)

PowerShell说"在这个系统上禁用了脚本的执行."

我正在尝试运行从命令提示符调用PowerShell脚本的.cmd文件,我收到以下错误:

无法加载Management_Install.ps1,因为在此系统上禁用了脚本的执行.

我跑了cmd.exe,当我Management_Install.ps1从PowerShell 运行时,我Get-ExecutionPolicy回来了.

// Powershell的输出

PS C:\ Users\Administrator> get-executionpolicy

无限制

//从DOS输出

C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scr

ipts> powershell.\ Management_Install.ps1 1

警告:运行x86 PowerShell ...

无法加载文件C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1,因为在此系统上禁用了脚本的执行.有关详细信息,请参阅"get-help about_signing".

在线:1个字符:25

  • .\ Management_Install.ps1 <<<< 1

    • CategoryInfo:NotSpecified:(:) [],PSSecurityException

    • FullyQualifiedErrorId:RuntimeException

C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> pause

按任意键继续 ...

该系统是Windows Server 2008 R2.

我究竟做错了什么?

powershell windows-server-2008-r2

1545
推荐指数
30
解决办法
193万
查看次数

Visual Studio代码cmd错误:无法加载,因为此系统上的运行脚本被禁用

在Visual Studio代码内部,我试图从命令行执行script.bat,但出现以下错误:

无法加载文件C:\ Theses_Repo \ train-cnn \ environment \ Scripts \ activate.ps1,因为此系统上的运行脚本已禁用。

读完这篇文章后,我试图以管理员模式运行Visual Studio代码,以为问题出在特权上。但是无论如何都会抛出错误。

powershell command-line visual-studio-code vscode-settings

3
推荐指数
13
解决办法
3666
查看次数