You could try something like this
Get-Datacenter|SelectName,
@{N="Storage Used (GB)";E={
$sum=Get-Datastore-Location$_|
where {$_.ExtensionData.Summary.MultipleHostAccess-and$_.Type-eq"VMFS"} |
Measure-Object-PropertyCapacityGB,FreeSpaceGB-Sum
[Math]::Round($sum[0].Sum-$sum[1].Sum,2)
}}
It will only take shared VMFS datastores into account.
If you use other datastore types you can change the Where-clause