PowerCLI Installation Guide

What is PowerCLI?

PowerCLI is a command-line interface for managing and automating all aspects of vSphere management, including networking, storage, VMs, guest OS, and more.
PowerCLI functions as a collection of PowerShell modules that contain more than 700 cmdlets (commands) to manage VMware infrastructure.

Prerequisite

PowerShell version 5.1 or later is required to run PowerCLI cmdlets.
For more information, see PowerCLI compatibility matrixes.

What is PowerShell?

PowerCLI runs on top of PowerShell, which is a cross-platform task automation and configuration management framework. It consists of a command-line shell and a scripting language.
PowerCLI uses PowerShell’s basic syntax and concepts.

Get Started

To get instructions for installing PowerCLI, choose your operating system.
Prerequisite
PowerShell
PowerShell is installed by default with Windows OS or Windows Server.
Step 1
Install PowerCLI
Online
You can install PowerCLI directly from the PowerShell Gallery.

#Execute the command below to install VMware PowerCLI

Install-Module -Name VMware.PowerCLI
Offline
1. Download the .zip file with the latest released PowerCLI version from here.

2. To retrieve the folder(s) on your machine that contain PowerShell modules, execute the following command.
$env:PSModulePath
3. Extract the downloaded .zip file to one of the listed folders.

4. Unblock the copied files.
cd path_to_powershell_modules_folder Get-ChildItem * -Recurse | Unblock-File
5. Verify if the PowerCLI module is available on your system.
Get-Module -Name VMware.PowerCLI -ListAvailable
Step 2
Explore Cmdlets
VMware PowerCLI consists of multiple modules that you can install and use according to your needs and environments. Usually modules correspond to a VMware product.

Update PowerCLI

Execute the following command to update PowerCLI.
Update-Module -Name VMware.PowerCLI
Note: You cannot update the PowerCLI module online if you have installed it by the offline method. In this case, perform an offline installation of the latest PowerCLI version.
Prerequisite
Step 1
PowerShell
See the detailed instructions to install PowerShell 7 on a Linux box here.
Step 2
Install PowerCLI
Online
You can install PowerCLI directly from the PowerShell Gallery.

#Execute the command below to install VMware PowerCLI

Install-Module -Name VMware.PowerCLI
Offline
1. Download the .zip file with the latest released PowerCLI version from here.

2. To retrieve the folder(s) on your machine that contain PowerShell modules, execute the following command.
$env:PSModulePath
3. Extract the downloaded .zip file to one of the listed folders.

4. Unblock the copied files.
cd path_to_powershell_modules_folder Get-ChildItem * -Recurse | Unblock-File
5. Verify if the PowerCLI module is available on your system.
Get-Module -Name VMware.PowerCLI -ListAvailable
Step 3
Explore Cmdlets
VMware PowerCLI consists of multiple modules that you can install and use according to your needs and environments. Usually modules correspond to a VMware product.

Update PowerCLI

Execute the following command to update PowerCLI.
Update-Module -Name VMware.PowerCLI
Note: You cannot update the PowerCLI module online if you have installed it by the offline method. In this case, perform an offline installation of the latest PowerCLI version.
Step 1
PowerShell
See the detailed instructions to install PowerShell 7 on a MacOS here.
Step 2
Install PowerCLI
Online
You can install PowerCLI directly from the PowerShell Gallery.

#Execute the command below to install VMware PowerCLI

Install-Module -Name VMware.PowerCLI
Offline
1. Download the .zip file with the latest released PowerCLI version from here.

2. To retrieve the folder(s) on your machine that contain PowerShell modules, execute the following command.
$env:PSModulePath
3. Extract the downloaded .zip file to one of the listed folders.

4. Unblock the copied files.
cd path_to_powershell_modules_folder Get-ChildItem * -Recurse | Unblock-File
5. Verify if the PowerCLI module is available on your system.
Get-Module -Name VMware.PowerCLI -ListAvailable
Step 3
Explore Cmdlets
VMware PowerCLI consists of multiple modules that you can install and use according to your needs and environments. Usually modules correspond to a VMware product.

Update PowerCLI

Execute the following command to update PowerCLI.
Update-Module -Name VMware.PowerCLI
Note: You cannot update the PowerCLI module online if you have installed it by the offline method. In this case, perform an offline installation of the latest PowerCLI version.