Created
November 18, 2017 18:44
-
-
Save 248968499/ae18b3657bdb037e76c8086dd630bca4 to your computer and use it in GitHub Desktop.
PowerShell 无法加载文件ps1,因为在此系统中禁止执行脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
直接运行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