HowTo: VMware PowerCLI Installation on Windows

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.

Figure 1

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.

Figure 2

Wait for the installation to complete as shown in the screenshot below.

Figure 3

Re-running Get-Module cmdlet from step 1 will now display VMware modules.

Figure 4

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.

Figure 5

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
Figure 6

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.

Figure 7