最佳答案
我试图运行一个cmd文件,从cmd.exe调用PowerShell脚本,但我得到这个错误:
无法加载
Management_Install.ps1,因为在此系统上禁用了脚本的执行。
我运行了这个命令:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted当我从PowerShell运行Get-ExecutionPolicy时,它返回Unrestricted。
Get-ExecutionPolicy输出:
Unrestrictedcd"C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Script"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
PSSecurityException: (:) [], 安全漏洞
请求参数
C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Script>PAUSE
按任意键继续…
系统是WindowsServer2008 R2。
我做错了什么?