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

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

修改方法:

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

Set-ExecutionPolicy Unrestricted

Powershell 脚本的4种执行权限

相关文章:

  • 2021-12-04
  • 2019-02-27
  • 2021-09-30
  • 2021-12-26
  • 2022-01-24
  • 2021-08-05
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-11-28
  • 2022-02-16
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案