Ste*_*mer 4 powershell powercli
在我的 PowerShell 快捷方式上,我有以下内容:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\""
Run Code Online (Sandbox Code Playgroud)
然而,我更愿意添加管理单元的注册并将 PowerCLI 环境的 init 运行到我的配置文件中。
所以在我的个人资料中,我添加了以下内容:
Add-PSSnapin VMware.VimAutomation.Core
& "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
Run Code Online (Sandbox Code Playgroud)
但是,使用此方法无法再使用 Get-VICommand。为什么?
归档时间: |
|
查看次数: |
12028 次 |
最近记录: |