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:
- PowerCLI 4.1.1 Poster This PowerCLI poster is printable on 4 sheets of standard paper.
- PowerCLI 5.0 Poster
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:
- PowerCLI 4.1 cmdlet reference: http://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/index.html
- PowerCLI 5.01 cmdlet reference: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/index.html
Other great resources:
- vTesseract – Resources for Getting Started with PowerCLI Automation
- 10 Steps to Kick-Start Your VMware Automation with PowerCLI
- Virtu-Al.net – http://www.virtu-al.net/ Nice resources of blog post and scripts.
- PowerShell.com – excellent resource for power shell tips and scripts.
- The VMware PowerCLI Community – VMware online community forum for PowerCLI.
- VMware vSphere PowerCLI Reference Book Website If you want to continue learning PowerCLI beyond what is covered in the class get this book.
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