ExecutionPolicy
powershell 对于脚本的执行有着严格的安全限制
- Get-ExecutionPolicy -List
- Set-ExecutionPolicy -Scope CurrentUser AllSigned
- Policies:
- Restricted / AllSigned / RemoteSigned / Unrestricted / Bypass / Undefined
- Scopes:
- Process / CurrentUser / LocalMachine
process 仅对当前进程有效, 可以用作临时使用, 例如:
Set-ExecutionPolicy Bypass -Scope Process -Force; NPM-Windows-upgrade
参考:
获取执行策略限制
设置执行策略限制
执行策略文档
https://chocolatey.org/install
来源: http://www.bubuko.com/infodetail-3069040.html