06 June, 2013

PowerCLI 5.1 Release 2 and VDS (Distributed Virtual Switch)

So prior to PowerCLI 5.1 Release 2 there was not a lot you could script with PowerCLI regarding the VMWare Distributed vSwitch (I deliberately use different names and abbreviations for the VDS as the official name changed over time and I lost track).
But now with the Release 2 there are a whole bunch of new cmdlets to work with VDS. Having these new cmdlets and the added support for vCloud Director 5.1 will give the VCD admin a lot of new automation possibilities.
I won't write a blog post on the new VDS cmdlets, for this I refer you to the blog post of Alan Renouf on Virtu-al.net.
A other thing supported by PowerCLI 5.1 Release 2 is PowerShell v3.0 and it's enhancements, one cool and very handy feature I want to point out. This feature is very handy when your new to PowerShell or PowerCLI and will give you a better understanding on how a command is "build". PowerCLI always had a syntax explanation of a cmdlet when you added "-Syntax" to your cmdlet, but this would give you a short description of all the parameters you could use with the specific cmdlet and is not really helpful if you do not exactly know what it is you are looking for or maybe doing wrong.
When you install PowerShell v3.0 and PowerCLI 5.1 Release 2 you can use the "show-command" cmdlet to get a small GUI for the cmdlet you want to use.

Let's look at a simple cmdlet "Connect-VIserver" you will need it for most PowerCLI scripts as this will connect you to a vCenter server(s) or ESXi Host(s).
When you run "show-command connect-viserver"

It will present a GUI in which you can enter the needed data, after when you click OK it will show and run the proper formed command to the PowerCLI prompt. This way you will know the next time how to use the cmdlet to get what you want (Ok maybe it will take you a couple of runs before you get it).

No comments:

Post a Comment