PowerCLI Installation and Update using PowerShell Gallery Memo
Since PowerCLI 6.5.1, you no longer have a MSI file to download and install: you can now install directly from the PowerShell Gallery. When using this system, the install is done completely through PowerShell itself using the PowerShell Gallery via PowerShellGet.
I’m using this post as a memo for various tips and info about the installation and update of PowerCLI via the PowerShell Gallery.
Pre-requisites:
- Uninstall any existing version of PowerCLI
- PowerShell 5.0 or above
- Administrator rights
To check your current PowerShell version, use $PSVersionTable.PSVersion
.
…or the Get-Host
cmdlet.
- You need to update PowerShell if your version is below 5.0. The reason is that the Install-Module cmdlet is missing from versions below 5.0. To get there, update the Windows Management Framework 5.1 (which includes PowerShell).
- If asked to install or update ‘NuGet Provider’, choose ‘Y’ to install or to get the newer version.
- If you start a Powershell session without administrator rights, you will get the following error message:
Useful commands:
Find-Module -Name VMware.*
Install-Module -Name VMware.PowerCLI -Scope AllUsers
: install in a location that is accessible to all usersInstall-Module -Name VMware.PowerCLI -Scope CurrentUser
: install in a location only available to the current userUpdate-Module -Name VMware.PowerCLI
Get-Module -Name VMware.* -ListAvailable
: get installed modules and available modules
Additional resources:
- How-to recreate a PowerCLI desktop shortcut
- Updating PowerCLI through the PowerShell Gallery
- PowerCLI stats on PowerShell Gallery
- VMware PowerCLI 6.5.1 Installation Walkthrough (Youtube)
- Check Automatically if PowerCLI is Up To Date With the Check-PowerCLIUpdate Script
- Obtaining Specific PowerCLI Versions from the PowerShell Gallery
Also, a quick note to end: PowerNSX is also available through PowerShell Gallery. #runNSX ;)