Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 248968499/ae18b3657bdb037e76c8086dd630bca4 to your computer and use it in GitHub Desktop.
Save 248968499/ae18b3657bdb037e76c8086dd630bca4 to your computer and use it in GitHub Desktop.
PowerShell 无法加载文件ps1,因为在此系统中禁止执行脚本
直接运行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即可执行脚本
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment