打开 VMware vSphere PowerCLI 出现
无法加载文件 C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"。所在位置 行:1 字符: 2
+ . <<<< "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Script
s\Initialize-PowerCLIEnvironment.ps1"
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
执行:get-executionpolicy 命令查看 策略
PS C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-executionpolicy
Restricted
显示为: Restricted 该策略不允许任何脚本运行
执行: set-executionpolicy remotesigned 修改执行策略
PS C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> set-executionpolicy remotesigned
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 http://go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): y
PS C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-executionpolicy
RemoteSigned
退出POWERCLI,再打开