直接运行powershell时提示“无法加载文件ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"。

主要是由于没有权限执行脚本。

运行get-help about_signing 提示了解执行策略输入

get-executionpolicy

 

显示 Restricted  

 

即不允许执行任何脚本。

通过命令

get-help set-executionpolicy 可知有以下执行策略:<Unrestricted> | <RemoteSigned> | <AllSigned> | <Restricted> | <Default> | <Bypass> | <Undefined>

然后修改其策略:

set-executionpolicy remotesigned即可执行脚本

相关文章:

  • 2022-01-06
  • 2021-11-08
  • 2021-05-05
  • 2021-06-17
  • 2022-12-23
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2021-07-06
  • 2021-08-05
  • 2021-05-12
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案