I had a colleague recently ask me if I could help him setup PowerCLI on his laptop. It dawned on me that instructions such as this would be beneficial to document for new users to PowerCLI. At its simplest, PowerCLI is a module for Windows PowerShell which allows you to interface and manage VMware vSphere. Installation and Update of PowerCLI can all be done from within PowerShell without the need to download and install anything manually.
Validate PowerShell Version:
- First make sure you are using PowerShell 5.1 or greater. This is important as it allows you to download and update modules directly from within PowerShell.
- Open PowerShell and Run as Administrator.
- Execute $psversiontable:
Download and Save PowerCLI Module:
- Execute Save-Module -Name VMware.PowerCLI -Path <path> where <path> is where you want the module to be stored on your computer for installation.
- Once downloaded, validate the components are listed in the directory path
- Execute Install-Module -Name VMware.PowerCLI
- Execute Update-Module -Name VMware.PowerCLI
- Note that when updating, you don’t actually remove the previous version. Once the update is complete, execute Get-Module -ListAvailable “VMware.PowerCLI” | select Version to see the versions installed.