Skip to content

Instantly share code, notes, and snippets.

@biacz
Last active August 16, 2019 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biacz/c07fbdfb8dd7d47145a1f47186db6f6f to your computer and use it in GitHub Desktop.
Save biacz/c07fbdfb8dd7d47145a1f47186db6f6f to your computer and use it in GitHub Desktop.
SLOW AF
$output = get-childitem -force \\$computer\c$\users\$user -Directory |
foreach-object {
$len = 0
measure-childitem $_.FullName -ErrorAction SilentlyContinue | foreach-object { $len += $_.Size }
[pscustomobject]@{
Name = $_.FullName
SizeGB = [math]::round($len / 1Gb, 2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment