Skip to content

Instantly share code, notes, and snippets.

@vhusker
Created March 13, 2015 14:27
Show Gist options
  • Save vhusker/412f1017daefa442c932 to your computer and use it in GitHub Desktop.
Save vhusker/412f1017daefa442c932 to your computer and use it in GitHub Desktop.
Get combined desktop size of all users on a Terminal Server
#This can definitely be condensed into a line or two but this is a good illustration of the way I worked my way through this task
$DesktopFolders = Get-ChildItem -Path C:\Users\*\Desktop -Recurse
$DesktopFoldersSize = $DesktopFolders | Measure-Object -Property Length -Sum
$DesktopFolderSize
Count : 16072
Average :
Sum : 22536515116
Maximum :
Minimum :
Property : Length
($DesktopFolderSize.Sum)/1GB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment