How to install VMware PowerCLI
1.online installation
open PowerShell and execute following command
#查找模块
Find-Module -Name VMware.PowerCLI
#安装模块
Install-Module -Name VMware.PowerCLI -Scope CurrentUser
2. offline installation
1. check powerShell version
open poweShell and execute this command '$psversiontable',PSVersion need to be greater than 5.1
or you should download new powerShell from windows
2. download lastest version of PowerCLI
you can also download from the attachment
3. extract the compressed file
4. copy file to target directory
copy VMware.PowerCLI directory to C:\Windows\System32\WindowsPowerShell\v1.0\Modules
5. import module
execute following , and you will see "Welcome to VM PowerCLI"
Import-Module VMware.PowerCLI
6. Configuration
close customer experience improvement program
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
ingore certification verify
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
7.connect to vCenter
Connect-VIServer -Protocol https -User ‘administrator@vsphere.local’ -Password ‘yourpass’ -Server 'vCenterIP'
after repsonse, you can user powercli command, for example:
// 获取主机:
Get-VMHost
// 获取虚拟机:
Get-VM