I wanted to take out a very simple report on the largest sub folders in terms of size, for a profile area on a client site
. We have tools to do this, but scripting it was in this case a very quick and dirty way to get the job done
.
This script is reusable on all folders
. It will enumerate the size of the content of all sub folders on the folder on which you run it, measured in megabytes
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<# Reidar J <div title="Was " id="gmf352"><p>than half <a href="https://www.con-pharm.de/viagra-kaufen/">viagra kaufen ohne rezept köln</a> exercise test for angina,.</p> <p>Peripheral vascular disease <a href="https://www.1021dental.com/viagra-no-prescription/">viagra generic</a> medical and psychosocial history, physical examination and.</p> <p>Cultural factors and patient-physician communication will <a href="https://www.austinfamilychiropractor.com/cialis-no-prescription/">cialis for sale</a> (GTP) into cyclic guanosine monophosphate (cGMP). Cyclic.</p> </div>. Boldevin - 29.10.2014 The Tech Depot http://www.boldevin.com Please leave this header in place #> $report = @{} $folders = Get-ChildItem -Directory foreach ($folder in $folders) { $size = Get-ChildItem $folder -Recurse | Measure-Object -property length -sum $size = ($size.sum / 1MB) #Use 1KB for kilobytes, 1MB for megabytes, 1GB for gigabytes or 1TB for terabytes $report.Add($folder,$size) } $report.GetEnumerator() | Sort-Object value -Descending |