PowerCLI 6.5.1 has been released and in this release we have made some big changes to the way you install and keep up to date with PowerCLI! This update was all based around Microsoft PowerShell deployment models, listening to you, the customer and ensuring we are making the changes to provide the best PowerShell product going forward.
As of PowerCLI 6.5.1, you no longer have a MSI file to download and install. You can now install directly from the PowerShell Gallery! This update streamlines the install process in multiple ways and allows module based features which PowerShell users will be used to from other PowerShell based additions.
What does this mean for you?
PowerCLI being on the PowerShell Gallery means there are some changes that users should be aware of. The first big change, there is no more MSI to perform the install and therefore you don’t download it from the VMware website!
The install is done completely through PowerShell itself using the PowerShell Gallery via PowerShellGet. This means also means the other items which used to be installed by way of the MSI won’t be installed automatically. These things include the PowerCLI desktop shortcuts and the User Guide.
There are two ways in which you may install PowerCLI with this new method, online and offline. Let’s take a look at how to perform these methods.
The first step in moving to this new release is to uninstall any prior versions of PowerCLI which may be installed on the system by the old MSI installer, this is needed to move to the new distribution model.
It is also worth checking to ensure the “PowerCLI” folder has been removed from the following directory: C:Program Files (x86)VMwareInfrastructure
With the prior version of PowerCLI uninstalled, it’s time for the install!
Online Installation From a Computer with an Internet Connection
For the online install, start by confirming access to PowerShell Gallery and being able to find the PowerCLI module. This can be done by running the following:
Find-Module -Name VMware.PowerCLI
Note: If you have not accessed the PowerShell Gallery before, or perhaps have an out of date version of NuGet, you may receive a message indicating there is a missing or out-of-date NuGet provider. NuGet is a Package Management provider. These are primarily used to install, upgrade, configure, and/or remove software in an automated fashion. To accept the installation of a proper version of NuGet, hit “Y”.
We will now make use of the Install-Module cmdlet to make PowerCLI actually available on the local system. This can be done with the following:
Install-Module -Name VMware.PowerCLI –Scope CurrentUser
You will notice we’re only installing it for the current user, we do this because it doesn’t require admin access! If you would like it available for all users of the computer, your PowerShell session will have to be running as an administrator, and PowerCLI will automatically be installed for all users by changing the Scope parameter to AllUsers.
Success! We now have the PowerCLI modules installed and available locally!
Offline Install of PowerCLI to a Computer Without an Internet Connection
The following method should be used to install PowerCLI through the PowerShell gallery for those systems which do not have access to the internet. You will need at least one system that has internet access and a way to move the files to the target computer.
While on a system that has internet access, we will find the PowerCLI module with the same command we ran above:
Find-Module -Name VMware.PowerCLI
Then we can download the module for offline consumption with the following command:
Save-Module -Name VMware.PowerCLI -Path C:PathToDesiredFolder
At this point, we’ll want to copy those downloaded folders and place them on the system without internet access in a location where PowerShell can find them, this is the modules folder and can be confirmed by typing $ ENV:PSModulePath at the powershell prompt.
Local User: $ homeDocumentsWindowsPowerShellModules
All Users: $ pshomeModules
One of the great enhancements in PowerCLI 6.5.1 means we no longer need to load the modules into the PowerShell session as we may have done in the past, as soon as the modules are loaded into the module folder PowerShell will automatically be aware of their existence and you will find the cmdlets registered with the PowerShell session. Normal PowerShell behaviour meanst that as soon as you use the first cmdlet the PowerCLI module will be loaded as needed.
But what about the nice PowerCLI Welcome message and other functions which existed to make PowerCLI easier to use when we launched the old desktop icon?
First, we can mimic the desktop shortcuts by simply running: Import-Module VMware.PowerCLI
Please note the warning message about joining the Customer Experience Improvement Program (CEIP). We recommend enabling CEIP, as it’s greatly helps us improve our products! In order for the message to not appear, you either have to enable or disable CEIP by way of the Set-PowerCLIConfiguration cmdlet.
The other option to load the cmdlets, simply use the cmdlets as you normally would. The modules will auto-populate as necessary!
Here’s an example of using a new PowerShell session and connecting to a vCenter Server:
We can see the session begins without any PowerCLI modules being imported. After typing in the Connect-VIServer cmdlet (tab complete is fully operational as well), we can see the VMware.VimAutomation.Core module has been imported automatically! The other modules won’t be imported until they’re referenced.
Re-Creating The Desktop Shortcut
I know there are quite a few fans of the Desktop shortcut, so I’ll briefly describe how to set that up. First, create a shortcut that points to the PowerShell executable and place it on the desktop. Next, right click the newly created desktop shortcut and select properties. You should find yourself on the “Shortcut” tab. Enter the following values:
Target: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -noe -c “Import-Module VMware.PowerCLI”
Start In: C:
Shortcut Key: None
Run: Normal Window
Comment: Launch VMware PowerCLI
In the end, we should have something quite similar to the following:
This new install method is a very exciting improvement for PowerCLI. As seen above, this definitely streamlines the process of getting PowerCLI installed and accessible!
To find out more about the other fantastic improvements that are available with VMware PowerCLI 6.5.1, please see the following blog: New Release – PowerCLI 6.5.1