Last active
July 17, 2023 06:28
-
-
Save ulve/7e505b2487837afcc7fb to your computer and use it in GitHub Desktop.
du-h in powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([string]$Directory) | |
get-childitem $Directory | | |
% { $f = $_ ; | |
get-childitem -r $_.FullName | | |
measure-object -property length -sum | | |
select @{Name="Namn";Expression={$f}},@{Name="Sum (Mb)"; Expression={"{0:N1}" -f ($_.sum / 1MB)}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment