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即可执行脚本

posted on 2016-06-06 11:59  mick-li  阅读(9333)  评论(0编辑  收藏  举报

导航