Try something like this
Get-VDPortgroup |
Select -Property Name,@{N='VDSwitch';E={$_.VDswitch.Name}},NumPorts,
@{N='Used';E={(Get-VDPort -VDPortgroup $_ | where{$_.ConnectedEntity}).Count}},
@{N='Free';E={$_.NumPorts - (Get-VDPort -VDPortgroup $_ | where{$_.ConnectedEntity}).Count}}