Quick Start with Power CLI 12.7

Posted on Updated on

I was tasked with setting and testing a quick PowerCLI command today and my system was a bit behind. Of course I took to Youtube to find how to get started quickly with PowerCLI but most of the videos I located were too complex. In this quick blog post I’m going to go over the steps I took to update my Windows Environment with PowerShell, Install PowerCLI, and get it up and running.

Note: this procedure is for Windows systems that are connected to the Internet. There are manual ways to install PowerCLI. However, this post doesn’t cover that process. Additionally, there are Prerequisites to installing PowerCLI, check out this link for more information.

First — I checked to see what version of PowerShell (PS) I have installed. I opened a PowerShell command window as Admin and entered the following command. $PSVersionTable. From the output I could see I had 5.1.19041…

I could have also entered $PS.versionTable.PSversion

Note: Newer versions of Windows should have PowerShell installed by default. If you don’t have PowerShell installed follow this guide for 5.1.

Second – Now it was time to install PowerCLI

  1. Open the PS5 App as Admin
  2. Run this command to download – Install-Module -Name VMware.PowerCLI
    • Read and answer Yes or All when prompted (Be patient it may take a bit)
  3. Next you’ll need to Set Execution Policies:
    • Enter the command – ‘Set-ExecutionPolicy RemoteSigned’
    • More info on Execution Policies HERE
  4. Next command: ‘Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false’

Third – Ensure PowerCLI Commands are working

  1. With the PowerShell APP open try this commend to see the version of PowerCLI
    • ‘Get-PowerCLIVersion’ << Deprecated command, but works for now
    • Also ‘Get-Module’ will tell you the version
  2. Connect to your vCenter Server
    • Enter the command ‘Connect-VIServer [FQDN or IP]
    • Once Connected try the command ‘Get-VM’ to see a list of VM’s

These commands might seem simple but I was amazed by the amount of trial and effort it took to get PowerCLI up and running. I’m sure there are other issues folks might run into. If you do run into an issue post a comment below and I’ll be glad to help out.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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