ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

How to use Chocolatey to install PowerCLI module and connect to your vCenter Server

By Vladan SEGET | Last Updated: January 11, 2024

Shares

In the past, I have published some really useful blog posts for ESXi CLI commands. You were absolutely delighted to find some of those in the past, and going. Those posts are the pillars that I'm building on. So today's post try to add some more ESXi, vCenter CLI commands to the list of the blog posts which has talked about those too – How to use Chocolatey to install PowerCLI and connect to your vCenter Server.

The fact that the blog ages, as well as VMware products, those posts has to be kept updated, and this is really challenging. While one needs to focus on the creation of the new content, the older posts needs to be maintained as well, sometimes.

For those of you who are new to this blog, you should know that this blog runs since over 10 years as a “one-man” IT resource, (https://www.vladan.fr/about/) and that as every IT resource out there, even this one needs to function by paying the bills etc. Your support would be greatly appreciated!

OK let's go. First, I'd like to do a quick recap of what has already been published, so here we go:

VMware CLI Commands posts:

  • ESXi Commands List – Getting started – basic commands (esxcfg-nics, esxcli system, esxcli system version get, esxcli storage…..)
  • ESXi CLI Networking commands – some networking stuff (esxcli network, network nic, network nic list, network vm list, network ip, network vswitch…)
  • ESXi Commands List – Snapshot Deletion Monitoring – snapshots troubleshooting ( ls -al, watch -d ‘ls -luth | grep -E “delta|flat|sesparse”‘, ls -lrth |grep -E “flat|delta|sesparse” )
  • ESXi Commands List – Storage – some multipathing, nmp… –  (esxcli storage nmp device list, esxcli storage core device vaai status get -d <naaID>, esxcli storage core device list -d <naaID>, esxcli storage core path list)
  • How To do a Dry Run of an esxcli Installation or Upgrade on VMware ESXi – this post teaches you that you have a posibility to test istallation/upgrade of ESXi without possibly breaking things, via “esxcli –server=server_name software profile install –dry-run”. It is not an an actual installation/upgrade) only test run, which shows you a large list of vibs and drivers which will be installed, as well as if the final reboot is required (usually yes). Completely at the end, there is also a message which shows which VIBs will be skipped during the process.
  • How To Install VMware PowerCLI via PowerShell – we have this post about the installation of PowerCLI via Powershell, however there are other ways to install PowerCLI. One of the ways is to use chocolatey!

How to use Chocolatey to install PowerCLI and connect to your vCenter Server

Prerequisites

Before you begin, you need to have the following:

  • A Windows system with PowerShell 5.1 or higher
  • A vCenter server that you want to connect to
  • Chocolatey, a package manager for Windows, installed on your system.

If you don't have chocolatey installed on your system, there is a one-liner on chocolatey website. Then you can simply go ahead and install VMware PowerCLI.

choco install vmware-powercli-psmodule

After some long list of installations, (note that Dotnet has to be installed and updated as well), you'll finally have the Chocolatey to install PowerCLI and connect to your vCenter Server.

How to use Chocolatey to install PowerCLI and connect to your vCenter Server

and then, if you are using default certificates, you'll like to ignore the errors preventing you to connect via this:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

If not we'll have an error saying that the certificate is invalid. We certainly do want the connection without errors, right?

when connecting via

Connect-VIServer -server <ip_of_your_vcenter>

you'll get a windows prompt for user name and password, then the connection to your vCenter server is estabilished.

How to use Chocolatey to install PowerCLI and connect to your vCenter Server

Running Basic Scripting

Once you are connected to the vCenter server, you can use the PowerCLI cmdlets to perform various administration or monitoring tasks on your vSphere environment. For example, you can use the following command to get the list of all virtual machines in your vCenter server:

Get-VM

This will display the information about the virtual machines, such as the name, power state, guest OS, CPU, memory, and disk usage.

You can also use the PowerCLI cmdlets to create, modify, or delete virtual machines, hosts, clusters, datastores, networks, and other vSphere objects. You can also use the powercli cmdlets to perform actions on the vSphere objects, such as starting, stopping, suspending, or migrating virtual machines, or adding, removing, or updating hosts, clusters, datastores, networks, and other vSphere objects.

For more information about the PowerCLI cmdlets, you can use the Get-Help cmdlet to display the help topics for each cmdlet, for example:

Get-Help Get-VM

This will display the help topic for the Get-VM cmdlet, including the syntax, parameters, examples, and related links.

Note: When you run this command for the first time, in the background, it get some latest updated help files.

then only, you'll see the options….

 

Conclusion

VMware PowerCLI is a powerful command-line tool that lets you automate and manage various aspects of your vSphere environment.

In this blog post, I showed you how to connect via VMware PowerCLI to your vCenter server by using chocolatey to install the PowerCLI module on windows system. I hope you found this post useful and learned something new. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading!

 

More posts from ESX Virtualization:

  • VMware vSphere 8.0 U2 Released – ESXi 8.0 U2 and VCSA 8.0 U2 How to update (NEW)
  • What’s the purpose of those 17 virtual hard disks within VMware vCenter Server Appliance (VCSA) 8.0?
  • VMware vSphere 8 Update 2 New Upgrade Process for vCenter Server details
  • VMware vSAN 8 Update 2 with many enhancements announced during VMware Explore
  • What’s New in VMware Virtual Hardware v21 and vSphere 8 Update 2?
  • Homelab v 8.0 
    • NXJ6412 Maxtang EHL30 TPM Alert in vCenter Server 8.0 BIOS Config
    • vSphere 8 Lab with Cohesity and VMware vExpert gift – Maxtang’s NX 6412 NUC
    • VMware Cohesity vExpert Gift VMware EXPLORE 2022 Barcelona
  • vSphere 8.0 Page
  • Veeam Bare Metal Recovery Without using USB Stick (TIP)
  • ESXi 7.x to 8.x upgrade scenarios
  • A really FREE VPN that doesn’t suck
  • Patch your ESXi 7.x again
  • VMware vCenter Server 7.03 U3g – Download and patch
  • Upgrade VMware ESXi to 7.0 U3 via command line
  • VMware vCenter Server 7.0 U3e released – another maintenance release fixing vSphere with Tanzu
  • What is The Difference between VMware vSphere, ESXi and vCenter
  • How to Configure VMware High Availability (HA) Cluster

Stay tuned through RSS, and social media channels (Twitter, FB, YouTube)

Shares
5/5 - (1 vote)

| Filed Under: Free Stuff, Server Virtualization Tagged With: How to use Chocolatey to install PowerCLI module and connect to your vCenter Server

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • FREE version of StarWind VSAN vs Trial of Full version
  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!
  • Installation of StarWind VSAN Plugin for vSphere
  • Protect Mixed environments with Nakivo Physical Machine recovery (bare metal)
  • No more FREE licenses of VMware vSphere for vExperts – What’s your options?
  • Tails – Your Private OS on USB Stick
  • StarWind V2V Converter Now has CLI
  • Veeam VHR ISO v2 – 2025 Download and Install
  • Deployment OVA and Installation of Nakivo Backup and Replication for VMware

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in