PowerCLI Class References and Resources

I am currently teaching the VMware vSphere: Automation with vSphere PowerCLI [V4.x] as part of the VMware IT Academy program offered at Tidewater Community College (TCC).

Here are a few of the online resources that I have referenced in the class:

VMware vSphere: Automation with vSphere PowerCLI [V4.X] course description/outline – http://www.vmware.com/go/vsphereautomation

Download the latest version of VMware PowerCLI and get access to the PowerCLI documentation at http://www.vmware.com/go/PowerCLI

PowerCLI Posters and Reference Cards:

ProfessionalVMware.com BrownBag PowerCLI 101
This BrownBag Video is a great PowerCLI primer.

ProfessionalVMware BrownBag – PowerCLI 101 w/ Glenn Sizemore from ProfessionalVMware on Vimeo.

Cmdlet References:

Other great resources:

If anyone has any useful PowerCLI resources please add a comment and I will update the post.

Some PowerCLI Quick Notes

#Connecting to a vSphere Host
connect-VIServer vSphereServerIPorHostname

#Cmdlets are composed of a verb and a noun separated by a –
Get-DeathStar | Get-Target -Type “ExhaustVent” | Where {$_.Size -eq “WompRat”} | Set-Fire -Force:$true
#Above pseudo power shell inspired by Josh at http://www.vtesseract.com/ Check out his site for more great pseudo (and real) CLI

#Common PowerCLI cmdlet verbs:
Get – Retrieves
New – Creates
Set – Sets or Changes
Remove – Destroys

#Common PowerCLI cmdlet nouns:
VMHost – ESXi Host
Datacenter – vSphere Datacenter
Cluster – vSphere HA/DRS Cluster
VM – Guest Virtual Machine

#cmdlet help
Get-Help Get-VM
#Add the -examples parameter to get usage example

#Output passed as an argument to another cmdlet using the “pipe” |
Get-VMHost $VMHost | Get-VMHostNetwork

#Use Where to filter objects and Select to display object properties
Get-VM | Where {$_.Name -like “mercury*”} | Select Name, PowerState, MemoryMB, NumCPU | convertto-html > C:\reports\mercury.html

#Don’t forget to disconnect
Disconnect-VIServer vSphereServerIPorHostname


Hersey Cartwright is an IT professional with extensive experience designing, implementing, managing, and supporting technologies that improve business processes. Hersey is Solutions Architect for HPE SimpliVity covering Virginia, Washington DC, and Maryland. He holds the VMware Certified Design Expert (VCDX-DV #128) certification. Hersey actively participates in the VMware community and was awarded the VMware vExpert title in 2016, 2015, 2014, 2013, and 2012. He enjoys working with, teaching, and writing about virtualization and other data center technologies. Follow Hersey on Twitter @herseyc

Leave a Reply

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