Comment

Great work, a really helpful script

As for the duplicity, the output is a portgroup per host in the cluster, (ie: 2 hosts = 2 entries, 4 hosts = 4 entries)

I suppose because $ClustervPortsData = $cluster |get-vmhost | Get-VirtualPortGroup | select @{n="Cluster";e={$cluster.name}},Name returns an entry per host...

Even so it doesn't return entries if the pg is used by one vm on only one host in the cluster

Using the remove duplicates function in the data tab of excel it's easy to remove these