I found a few scripts and this one seems to be close. The problem is the sizes are not adding up for instance the writable_templates folder has 3 80mb tempates so it shouldn't be 30gb. I think I am seeing what the inflated Thick provision size would be but I would like to see the size on disk for all of our appvolumes. Mainly concerned about the Apps folder to have a quick way to get how much of the VSAN this is using.
$datastores = Get-Datastore
foreach($ds in $datastores){
New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root "\" > $null
Get-ChildItem -Path DS:\cloudvolumes | where{$_.ItemType -eq 'Folder' -and $_.Name -notmatch '^\.|^vmk|^esxconsole|tmp'} | %{
New-Object PSObject -Property @{
Datastore = $ds.Name
Folder = $_.Name
SizeGB = [math]::Round((Get-ChildItem -Path "DS:\cloudvolumes\$($_.Name)" | Measure-Object -Property Length -Sum | select -ExpandProperty Sum)/1GB)
}
}
Remove-PSDrive -Name DS -Confirm:$false
}
Datastore SizeGB Folder
--------- ------ ------
DS01 30 writable_templates
DS01 0 writable
DS01 745 apps
DS01 230 apps_templates