Powershell and PowerCLI

Have you ever wanted to work on your VMware environment and your Windows environment using one command line tool? Maybe write scripts for both with the same tool? Powershell with VMware PowerCLI cmdlets allow you to stay in PowerShell and manage both. Let’s start with some the basics. Ensure you can connect to the Powershell Gallery and find the VMware.PowerCLI Powershell module.
Run: Find-Module -Name VMware.PowerCLI

Install the VMware PowerCLI module
Run: Install-Module -Name VMware.PowerCLI

Check the number of cmdlets installed
Run: Get-Command -Module *vmware* | measure

Connect to a vCenter using connect-viserver – server <your vcenter> and try this simple command.
Run: Get-VMhost

Try some of the other commands. They will make your life easier. There are many more third party PowerShell modules. Visit the Powershell Gallery. At last count, there were over 31,000 packages.

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 )

Google photo

You are commenting using your Google 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