I combined the virtualportgroup name and the VLanId, you'll get something like "pg1-123", where pg1 is the portgroupname and 123 is the VLanId.
foreach($clusterinGet-Cluster){
foreach($esxinGet-VMHost-Location$cluster){
Get-VirtualSwitch-VMHost$esx|
Select@{N="Cluster";E={$cluster.Name}},
@{N="ESXi";E={$esx.Name}},
@{N="vSwitch";E={$_.Name}},
@{N="Portgroups";E={[string]::Join(',',(Get-VirtualPortGroup-VirtualSwitch$_|%{"$($_.Name)-$($_.VLanId)"}))}}
}
}