Skip to content

Instantly share code, notes, and snippets.

View yeahservice's full-sized avatar

Dominik Augustin yeahservice

View GitHub Profile
@yeahservice
yeahservice / du.ps1
Last active December 21, 2019 22:47
Windows Powershell script for displaying directory sizes. Just copy it into the root directory and execute the script with Powershell.
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)