打開 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,再打開