win10 PowerShell 禁止运行脚本

win10 PowerShell 默认是禁止运行脚本的,

可以通过以下命令设置:

get-executionpolicy  查看对应配置

Restricted 执行策略不允许任何脚本运行。 
AllSigned 和 RemoteSigned 执行策略可防止 WindowsPowerShell 运行没有数字签名的脚本。

set-ExecutionPolicy RemoteSigned   设置

PS C:\Users\12160> get-executionpolicy
Restricted
PS C:\Users\12160> set-ExecutionPolicy RemoteSigned

执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“N”): y
PS C:\Users\12160> get-executionpolicy
RemoteSigned
PS C:\Users\12160>

 

你可能感兴趣的:(win10,node.js,win10,pwoershell)