Powershell 脚本的4种执行权限

Powershell脚本的4种执行权限介绍

  • Restricted - 默认的设置, 不允许任何script运行
  • AllSigned - 只能运行经过数字证书签名的script
  • RemoteSigned - 运行本地的script不需要数字签名,但是运行从网络上下载的script就必须要有数字签名
  • Unrestricted - 允许所有的script运行

windows默认不允许任何脚本运行,可以使用 "Set-ExecutionPolicy" cmdlet 来更改这个策略。

修改方法:

右键 powershell 图标 选择 “Run as Administrator”, 执行以下语句 -> "y" 即可。

Set-ExecutionPolicy Unrestricted

原文地址:https://www.cnblogs.com/unchch/p/powershell.html