相关疑难解决方法(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万
查看次数

为什么我突然得到: ng : File C:\Users\d\AppData\Roaming\npm\ng.ps1 无法加载

多年来我一直愉快地使用 vscode/angular/node/npm ,没有出现任何问题。突然在最后一个小时左右,没有明确更改任何内容,我收到以下错误。

先前存在的执行权限突然丢失的最可能原因是什么?

我不想提前说这些,但对于那些无法理解的人,我并不是在问如何修复错误。我问为什么我的权限被擦除导致它出现。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\d> cd C:\source\my-WebApp
PS C:\source\my-WebApp> ng serve
ng : File C:\Users\d\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file
C:\Users\d\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 …
Run Code Online (Sandbox Code Playgroud)

npm visual-studio-code angular

11
推荐指数
1
解决办法
3万
查看次数

为什么Powershell不运行Angular命令?

我已经开始学习Angular了,但是我注意到Windows中的powershell每当执行如下的angular命令时都会出现错误:

ng new new-app
Run Code Online (Sandbox Code Playgroud)

要么

ng serve
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

ng : File C:\Users\< username >\AppData\Roaming\npm\ng.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
+ ng serve
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)

PS我尝试在cmd中的这些命令,它的工作原理。

javascript powershell angular-cli angular

3
推荐指数
4
解决办法
1万
查看次数