Quick and Dirty Powershell Script to Check PVS Write Cache Sizes


Add-PSSnapin Citrix*
$reg=get-brokerdesktop -MaxRecordCount 9999 -RegistrationState Registered -DesktopGroupName VDIWIN7 -adminaddress citrixdc.contoso.local
$results=@(); $reg | %{ $comp=$_.hostedmachinename; $cache=dir "\$compD$.vdiskcache" -force; $results+="$comp;$($($cache.length)/1GB)"}
$path0="D:WriteCachelatest.txt"
$path1="D:WriteCachewc_$(get-date -format `"yyyy-MM-dd_hh-mm_ss`").txt"
$results | out-file $path0
$results | out-file $path1

Using this script you can go to Excel, Data, Import from Text, select Latest.txt, pivot table. Then all you need to do is click refresh in Excel after running this on whatever schedule you want.

Leave a comment

Your email address will not be published.