Folder Size Calculation

The script shows you the TOP 5 folders by size for a folder on your windows server or a UNC share. It can also list you the TOP 5 folders for any specific extensions.

 
 
 
 
 
4 Star
(1)
Add to favorites
Storage
9/8/2010
E-mail Twitter del.icio.us Digg Facebook
  • Not functioning as expected?
    3 Posts | Last post May 06, 2012
    • I came across this script and it would be perfect for a script I have but the results are missing random folders that should be in my top 5.
      
      I can't seem to find any pattern as to why but am wondering if anyone has come across how to fix this.  
      
      I found a couple of other solutions that do seem to work but I like the way this one integrates with my script.
      
      Thanks
      c
    • Are you running with a local windows administrator account? And are there any specific ACL modifications on a particular folder which is leading to an access denied error. Remove the "-ErrorAction SilentlyContinue" in the script and run the script to check what errors are reported.
    • Thanks for the reply.. :)
      Yes.. I am on as a local admin, with no ACL mods to this folder structure.
      I ran it with out the ErrorAction and it completes the script without errors.
      
      The odd part is that if I uncomment this:
      Write-Host ($i.FullName + ": " + "{0:N2}" -f ($vFolderSize / 1MB) + " MB") 
      
      I can see it report back all of my subfolder in the path correctly, so I am thinking the way the code modifies the array may be where I am running into the issue?
      
      Thanks for your time.. :)
      c