Skip to content

Instantly share code, notes, and snippets.

@mbrownnycnyc
Created April 8, 2015 12:55
Show Gist options
  • Select an option

  • Save mbrownnycnyc/9915763ea2663b00ebf8 to your computer and use it in GitHub Desktop.

Select an option

Save mbrownnycnyc/9915763ea2663b00ebf8 to your computer and use it in GitHub Desktop.
quick get-folder implementation
#http://blogs.technet.com/b/heyscriptingguy/archive/2013/08/03/weekend-scripter-use-powershell-to-get-folder-sizes.aspx
Function Get-FolderSize{
BEGIN{$fso = New-Object -comobject Scripting.FileSystemObject}
PROCESS{
$path = $args[0]
$folder = $fso.GetFolder($path)
$size = $folder.size
[PSCustomObject]@{'Name' = $path;'Size (KB)' = ($size / 1kb) } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment