Virtualisation

Install VMware PowerCLI and manage the virtual infrastructure

Working with virtual infrastructures can be a demanding job at times. Especially when there is an increasing demand of applications and workloads always available that need to be running pretty much everywhere! Surely the latest releases of vSphere Clients offer a nice view and management of the virtual infrastructures. What if need to find a more flexible and customizable way to deploy, manage and orchestrate these environments? Simple answer: we need scripting and this is what this article is about. It covers the process to install VMware PowerCLI. Super easy process that takes advantage of the latest PowerShell Core editions.

To install VMwarePowerCLI means benefitting from a seamless user experience when managing the virtual environments regardless if operating from a Windows, Linux or even Mac. Even more it is very simple to update to the latest versions taking advantage of updates to existing modules and access to the new ones.

With VMware PowerCLI in fact, it is possible to manage:

  • VMware vCenter from 5.5.0 to 6.7.0
  • VMware vSAN from 6.0 to 6.7
  • VMware NSX-T from 2.0 to 2.1.0

of course newer releases will include support for future versions as well.

There are plenty of benefits really to install VMwarePowerCLI. Including inventory, management, deployment, automation and orchestration. The bigger the environment the higher flexibility is required. From this perspective scripting allows to go the extra mile.

In particular there are two aspects deemed as important:

  • leverage a framework which provides a cross-platform support
  • ability to work with Modules and get access to the latest APIs. This is key considering actual infrastructures are evolving from On-Premises Data Centers to Public Clouds in hybrid deployments fashion.

VMware PowerCLI keeps evolving with new cmd-lets and parameters. It is always a good idea to update the installed version and keep an eye to the VMware PowerCLI change log page for the latest details. A Cmd-let reference and a User-Guide are also available.

 

Install VMware PowerCLI using PowerShell Core

Let’s start the PowerShell Core console as Administrator and issue the command:

“Install-Module VMware.PowerCLI”

Since we are installing this from an “untrusted” repository let’s accept with a “Y” for this instance.

domalab.com Install VMware PowerCLI Powershell Core

At this point the console will connect to initially download the necessary packages. Let’s confirm and proceed.

domalab.com Install VMware PowerCLI download modules

At this point PowerShell Core is ready to install all the necessary PowerCLI Modules in the %ProgramFiles%\WindowsPowerShell\Modules

domalab.com Install VMware PowerCLI install-module

To check the installation of the new VMware PowerCLI modules we can simply issue the command:

“Get-Module VMware* -ListAvailable”

domalab.com Install VMware PowerCLI list-module

As a first task we can try to connect to the vCenter Server using the Connect-VIServer cmd-let. As screenshot is showing below there are changes on how the latest editions of vSphere handle certificates making it more secure. So let’s make sure the right certificate is installed.

domalab.com Install VMware PowerCLI Connect-VIServer error

So let’s control the PowerCLI configuration with

“Get-PowerCLIConfiguration”

With this command we can get information about the Scope, ProxyPolicy and InvalidCertificateAction.

domalab.com Install VMware PowerCLI Get-PowerCLIConfiguration

With the “Set-PowerCLIConfiguration” we can change these values as required.

domalab.com Install VMware PowerCLI Set-PowerCLIConfiguration

Let’s confirm the change to the ProxyPolicy.

domalab.com Install VMware PowerCLI Policy

The command now show the current status.

domalab.com Install VMware PowerCLI Policy result

What if want to check and update VMware PowerCLI to the latest version? Very easily all needs to be done is to issue the following commands:

“Find-Module -name VMware.PowerCLI”

“Update-Module -name VMware.PowerCLI”

domalab.com Install VMware PowerCLI Update-Module

Similarly we can also use the “Uninstall-Module” command to remove the VMware PowerCLI. When multiple versions are installed this command always remove the latest version first. Of course it is possible to list the versions and remove specific ones:

Uninstall-Module -Name VMware.PowerCLI -RequiredVersion “Version”

About the author

Michele Domanico

Passionate about Virtualization, Storage, Data Availability and Software Defined Data Center technologies. The aim of Domalab.com is sharing with the Community the knowledge and experience gained with customers, industry leaders and like minded peers. Always open to constructive feedback and new challenges.

Add Comment

Click here to post a comment

Leave a Reply

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

Subscribe to Blog via Email

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

Browse articles

September 2018
M T W T F S S
« Aug    
 12
3456789
10111213141516
17181920212223
24252627282930

Articles by Category

Archives

%d bloggers like this: