This is a how-to article on how to perform VMware PowerCLI installation on Windows. PowerCLI is a module for Windows PowerShell, however, it also supports macOS and Ubuntu running PowerShell Core 6.x.
Installation procedure
Step 1. In this example, I’m using Windows 10 Professional. Start typing-in “powershell” and in search results right-click on the Windows PowerShell icon and select Run as Administrator.
Step 2. Validate that the system doesn’t have modules installed. In PowerShell console type in:
Get-Module -ListAvailable -Name VMware*
The cmdlet above displays currently imported and installed (with -ListAvailable) modules which have a name starting with VMware.
Step 3. To perform the installation:
Install-Module -Name VMware.PowerCLI
The prompt will appear with a warning of an untrusted repository. To proceed, type Y and wait for the installation to complete.
Wait for the installation to complete as shown in the screenshot below.
Re-running Get-Module cmdlet from step 1 will now display VMware modules.
Connect to ESXi Host or vCenter
To connect to VMHost use the following command:
Connect-VIServer <vm_host_ip_address_or_fqdn>
In many cases self-signed certificate is used with ESXi and the invalid certificate error will be raised, as shown in the screenshot below.
To get the system prompt for invalid certificates and remove warning about the Customer Experience Improvement Program type in:
Set-PowerCLIConfiguration -Scope User –ParticipateInCeip:$false -InvalidCertificateAction Prompt
To ignore the certificate warning and disable prompts use this variant of command:
Set-PowerCLIConfiguration -Scope User –ParticipateInCeip:$false -InvalidCertificateAction Ignore –Confirm:$false
Now Connect-VIServer will work after the certificate is accepted.
Pre-requisites and useful links
PowerCLI Official Downloads and Documentation page. This page contains other links below and has version switch which leads to documentation for the versions different than 11.5.0.
https://code.vmware.com/web/tool/11.5.0/vmware-powercli
Compatibility matrix (with pre-requisites):
https://code.vmware.com/docs/10257/compatibility-matrix
PowerCLI cmdlet reference:
https://code.vmware.com/docs/10197/cmdlet-reference
PowerCLI user guide:
https://code.vmware.com/docs/10242/powercli-11-5-0-user-s-guide
PowerShell Gallery:
https://www.powershellgallery.com/packages/VMware.PowerCLI/11.5.0.14912921