Powershell

VMware PowerShell Module Download

PowerShell has quickly become the defacto standard for automating Windows environments over the past several years. However, using PowerShell, admins can automate other environments, including VMware vSphere using PowerShell. PowerShell is a modular platform that extends PowerShell with both “snap-ins” and modules to add vendor-specific cmdlets into your PowerShell environment. In this quick how-to post, we will look at installing VMware PowerShell management with VMware PowerShell module download to manage and automate your VMware vSphere environment.

VMware PowerCLI – the VMware PowerShell Module

In case you are new to automating VMware vSphere environments with PowerShell, VMware’s PowerShell management module is called PowerCLI. The newest versions of PowerCLI are module-based which makes the management of PowerCLI much easier than the legacy “snap-in” that you used to have to download the MSI, install, and perform your own lifecycle management within the Windows programs and features environment.

VMware PowerCLI allows you to interact with vCenter Server to manage, configure, and automate your vSphere environment.

To install the VMware PowerShell module download, you can do this natively from within your PowerShell console. You can see the latest version of the VMware PowerShell module by issuing the command:

  • find-module VMware.PowerCLI
Finding-the-VMware-PowerShell-module-in-PowerShell-gallery-1
Finding the VMware PowerShell module in PowerShell gallery

This will display the latest version of PowerCLI that is available from the PowerShell Gallery. To install the module, you issue the cmdlet below:

  • Install-Module VMware.PowerCLI

As you can see, it will perform a VMware PowerShell module download and install the module in your PowerShell installation. Make sure you have administrative privileges and Internet access before you download and install VMware PowerCLI.

Installing-the-VMware-PowerShell-module-in-PowerShell
Installing the VMware PowerShell module in PowerShell

Next, you can import the module in PowerShell for use by issuing the command:

Import-the-VMware.PowerCLI-module-for-use-in-PowerShell
Import the VMware.PowerCLI module for use in PowerShell
View-the-version-information-of-your-VMware-PowerShell-module-installed-in-PowerShell
View the version information of your VMware PowerShell module installed in PowerShell

VMware PowerShell module – PowerCLI module cmdlets

Once you have installed the VMware PowerShell module, you can start using the module cmdlets available for use with PowerCLI. One of the first module cmdlets you will see is the ability to opt-in or out of the CEIP program with the VMware.PowerCLI module.

  • Set-PowerCLIConfiguration -scope user -ParticipateInCEIP $false

How do you connect to vCenter Server? This is another simple cmdlet once you have installed VMware.PowerCLI.

  • Connect-VIServer <your vCenter Server>

If you receive SSL errors when connecting to your vCenter Server, you can turn off SSL certificate checking with the following cmdlet:

  • Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

Updating VMware PowerShell Module Download

Once you have downloaded and installed the VMware PowerShell module in your PowerShell environment, performing lifecycle management is easily accomplished using the normal PowerShell update-module cmdlet. This makes updating to the latest and greatest VMware PowerCLI module version extremely easy.

As you can see below, you can see what version of the VMware.PowerCLI module you are running with the:

  • Get-Module VMware.PowerCLI

Then, you can update to the latest version of the VMware PowerShell module using the cmdlet:

  • Update-Module VMware.PowerCLI

You will be asked if you trust downloading from the PowerShell Gallery.

Updating-VMware-PowerCLI-module
Updating VMware PowerCLI module

PowerShell vs PowerShell Core

You may have questions regarding the VMware PowerShell module download based on the version of PowerShell you are using. When you download VMware PowerCLI in one version of PowerShell, such as Windows PowerShell, does this mean you will have the module installed automatically if you download PowerShell Core? No.

You will need to redownload VMware PowerCLI for each version of PowerShell you have installed. Which version is better? Both work equally well I would say with VMware PowerCLI. However, you will want to note that PowerShell Core is the newer of the two versions of PowerShell and will be the one moving forward that Microsoft will develop and recommend as the platform for most. It is also a cross-platform environment whereas Windows PowerShell is for Windows only. With PowerShell Core, you can run it on Windows, Linux, and Mac.

I also have noted many of the scripts I like to use from the community such as those from William Lam’s “Nested ESXi” scripts now require PowerShell Core as the cmdlets used in the script are from PowerShell Core. If you want to know which version of PowerShell Core to install, read my blog post here:

As a note, the process for installing and managing the lifecycle of your VMware.PowerCLI module in PowerShell Core is the same as Windows PowerShell. The cmdlets listed here all work with PowerShell Core as well.

Final Thoughts

The VMware PowerShell Module Download involves simply opening your PowerShell environment, whether Windows PowerShell or PowerShell Core and installing the VMware PowerCLI module from the PowerShell Gallery. Lifecycle management with the VMware PowerShell module is easy with the update-module cmdlet.

You can use the VMware PowerShell module in either Windows PowerShell or PowerShell Core. PowerShell Core has advantages to note such as the newest platform moving forward, cross-platform architecture, and the latest features and functionality. Many scripts are being written to take advantage of PowerShell Core now instead of Windows PowerShell.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.