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
参考: