Hi Lucd
Apologies for the late reply. Please find the below script.
Connect-VIServer -server "server name " -credential (get-credential)
$report = @()
foreach($cluster in Get-Cluster){
get-cluster $cluster | Get-VMHost | get-datastore | where {$_.Name -notmatch "local|snap"} | %{
#Get-VMHost -Location $cluster | Get-Datastore | %{
$info = "" | select DataCenter, Cluster, Name, Capacity, Provisioned, Available
$info.Datacenter = $_.Datacenter
$info.Cluster = $cluster.Name
$info.Name = $_.Name
$info.Capacity = [math]::Round($_.capacityMB/1024,2)
$info.Provisioned = [math]::Round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2)
$info.Available = [math]::Round($info.Capacity - $info.Provisioned,2)
$report += $info
}
}
$report | Export-Csv "C:\vmware\scripts\datastore\cluster-ds.csv" -NoTypeInformation -UseCulture