dvSwitch scripting – Part 12 – Find free ports

On the PowerCLI Community there was an interesting question about dvSwitches, portgroups and connecting VMs. Turns out you will need to provide a free port to connect a VM’s NIC to a portgroup on dvSwitch.
Since the solution is a nice follow up on my previous, somewhat lengthy post, called Variations on a port, I decided to create a short post on the subject in my dvSwitch series.

Update 3th March 2016: added test to capture portgroups with no VM connected to it

Continue reading dvSwitch scripting – Part 12 – Find free ports