html tool

2018年1月5日星期五

转: Powershell中禁止执行脚本解决办法

Powershell中禁止执行脚本解决办法

http://www.cnblogs.com/shanyou/archive/2011/09/03/2165371.html

PS C:\Windows\system32> get-ExecutionPolicy
Restricted
果然,是被限制。还是在"get-help about_signing"里面可以查到设置命令"set-executionpolicy"
再在帮助中找到"set-executionpolicy"的说明。。似乎是比较建议设置为,至少是被标记为可信任的
-- RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
在PowerShell执行以下:
PS C:\Windows\system32> set-ExecutionPolicy RemoteSigned
执行策略更改
执行策略可以防止您执行不信任的脚本。更改执行策略可能会使您面临 about_Execution_Policies
帮助主题中所述的安全风险。是否要更改执行策略?
[Y] 是(Y)  [N] 否(N)  [S] 挂起(S)  [?] 帮助 (默认值为“Y”): y
PS C:\Windows\system32>

没有评论:

发表评论