Home > Blogs > VMware PowerCLI Blog

What PowerCLI Version Am I On Anyways?

When PowerCLI was converted to modules, it introduced the ability to pick and choose which modules are loaded. Taking it a step further, it also allowed users to specify which versions of those modules are loaded. Historically, PowerCLI was released as one large ‘bundle’ of modules, and was not a great release practice. This meant that even though most modules were not touched, we were still required to go through our release processes to get them out the door. This is not scalable when trying to get features to you more frequently.

With modules in the Powershell Gallery, we can now release individual modules asynchronously from other modules. The first release to really take advantage of that is PowerCLI 6.5.2. For those whom have already updated their VMware.PowerCLI module from the Microsoft PowerShell Gallery, you noticed there were only 3 modules which were updated and needed to be downloaded.

The Better Way

In prior releases, we could use the ‘Get-PowerCLIVersion’ cmdlet and receive a high-level look at the overall PowerCLI version which was installed. Previously, our versioning scheme was not supported in PowerShell, so it took a cmdlet to print the version out (Example: VMware PowerCLI 6.5 R1). That is gone now. We’ve made the change to semantic versioning in 6.5.1. This means there will be no more R1, R2, or R3 releases!

Starting with PowerCLI 6.5.2, the process to get module versions has changed. Running the ‘Get-PowerCLIVersion’ cmdlet now results in a warning message indicating that it is deprecated and to use the ‘Get-Module’ cmdlet instead.

Example of the deprecation notice for Get-PowerCLIVersion

Using Get-Module

There are a couple ways to use the ‘Get-Module’ cmdlet to help us determine our versioning. The reason for that is because the ‘Get-Module’ cmdlet only shows the modules which have been imported.

The first way is to get the overall PowerCLI version, which is dependent on the ‘VMware.PowerCLI’ module. We can determine the version by first importing the module (if it’s not already imported) and then running the following command:
Get-Module -Name VMware.PowerCLI | Select-Object -Property Name,Version

Example: Obtaining the version of the VMware.PowerCLI module

From the above example, we can see that we’re using PowerCLI version 6.5.2.

Another way is to just reference the modules which have been loaded automatically. I have an example where we connect to our vCenter Server and then run the following command to find the versions of all the PowerCLI modules which are in-use:
Get-Module -Name VMware.* | Select-Object -Property Name,Version

Example: Obtaining the version of PowerCLI when using module autoloading

From the above example, we see that we’re only using a single PowerCLI module and it happens to be versioned at 6.5.2.

Running a couple additional, random, commands, we re-run the above command and see there’s now a bit more of a mix amongst our loaded modules.

Example: Obtaining the version of active PowerCLI modules


The new method to obtain what version of PowerCLI you’re using is through the ‘Get-Module’ cmdlet. This update was made for many reasons. This new method takes advantage of how our the PowerCLI modules can be loaded independently of each other on an as needed basis. It also takes advantage of how the PowerCLI module releases can now be done asynchronously from each other. Lastly, since we’ve changed the PowerCLI versioning over to align with the standard PowerShell versioning, there’s no need for a custom cmdlet anymore!

If you’re using ‘Get-PowerCLIVersion’ in your scripts or modules, make sure you’re aware of this and update your resources to reflect this change!

This entry was posted in General and tagged , on by .
Kyle Ruddy

About Kyle Ruddy

Kyle Ruddy is a Senior Technical Marketing Engineer at VMware in the Cloud Platform Business Unit. Kyle currently focuses on vSphere with Operations Management as well as all things API, SDK, and CLI. Kyle can be found blogging on VMware blogs, http://blogs.vmware.com/vSphere and http://blogs.vmware.com/PowerCLI, and his personal blog, http://www.thatcouldbeaproblem.com. You can follow Kyle on twitter as @kmruddy.

Leave a Reply

Your email address will not be published. Required fields are marked *