系统相关
首页 > 系统相关> > powershell无法执行脚本

powershell无法执行脚本

作者:互联网

powershell无法执行脚本

PS C:\Users\zbf> cnpm -v
cnpm : 无法加载文件 C:\Users\zbf\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/
go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ cnpm -v
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\zbf>

解决方法:

首先,以管理员身份运行 Windows PowerShell
然后,输入命令 set-ExecutionPolicy RemoteSigned 更改执行策略。

标签:脚本,zbf,Users,cnpm,PS,执行,powershell
来源: https://www.cnblogs.com/jiyuchen1/p/16564404.html