Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominik Augustin yeahservice

  • Dynatrace
  • Graz, Austria
View GitHub Profile
@yeahservice
yeahservice / du.ps1
Last active Dec 21, 2019
Windows Powershell script for displaying directory sizes. Just copy it into the root directory and execute the script with Powershell.
View du.ps1
Get-ChildItem -Directory | ForEach-Object {
"$_"
cd $_
switch((ls -r|measure -s Length).Sum) {
{$_ -gt 1GB} {
'{0:0.0} GB' -f ($_/1GB)
break
}
{$_ -gt 1MB} {
'{0:0.0} MB' -f ($_/1MB)