我正在尝试运行一个cmd从 调用 PowerShell 脚本的文件cmd.exe,但出现此错误:
Management_Install.ps1无法加载,因为在此系统上禁用了脚本的执行。
我运行了这个命令:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
当我Get-ExecutionPolicy从 PowerShell 运行时,它返回Unrestricted.
PS C:\Users\Administrator\> Get-ExecutionPolicy
Unrestricted
C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> 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 : 运行时异常
C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> PAUSE
按任意键继续 。. .
系统为 Windows Server 2008R2。
我究竟做错了什么?




