我正在尝试运行从命令提示符调用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.
我究竟做错了什么?
ng : File C:\Users\Lenovo\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file C:\Users\Lenovo\AppData\Roaming\npm\ng.ps1 is not digitally signed. You cannot run
this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ng serve
+ ~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)
在给 ng 服务时显示此错误..如何克服它?