Notes of a scripter

New Method for Installing PowerCLI

New Method for Installing PowerCLI

Starting with the newest version of PowerCLI, 6.5.1, the method for installation has changed from the typical MSI file to using the PowerShell Gallery.

Step 1. Uninstall PowerCLI

The first step is to uninstall PowerCLI from your system.  To do this use Add/Remove Programs.

Before Installing the New PowerCLI, the old installation needs to be removed.  Once the uninstall has completed, verify that the PowerCLI folder has been removed also by looking in the following directory.

If this folder exists, delete it

Step 2.  Find the PowerCli Module in the PowerShell Gallery

Using the following command you will be able find the new PowerCLI module in the PowerShell Gallery.

 Find-Module -Name VMWare.PowerCLI
This is the command to use to find the PowerCLI module

When this command is first ran, especially if this is the first time looking for modules from the PowerShell Gallery, you might get a message like the one below:

Prompt for upgrade NuGet Provider

So when you see this message you should just click ‘Yes’ to continue.

Step 3.  Install the PowerCLI Module

This step is straight forward, run the following command to install the module for the current user:

Install-Module -Name VMware.PowerCLI -scope CurrentUser

If this is a shared PC or you are installing it on a server that needs all users the ability to access the PowerCLI module use the following command*:

Install-Module -Name VMware.PowerCLI -scope AllUsers
Command for current user and all users install

*Note: PowerShell will need to be ran as administrator for the allusers installation

Step 4. Enjoy PowerCLI!

To enjoy your newly installed PowerCLI module just run the following command:

Import-Module VMware.PowerCLI
Import-Module VMware.PowerCLI

-Stuart

Exit mobile version