Created
August 18, 2017 01:54
-
-
Save JustinGrote/f4f5b9dae790602631d3b47825d36bd5 to your computer and use it in GitHub Desktop.
Remove Folders with less than a certain filesize in them. Works on Powershell Linux too with beta5
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
(get-childitem) | % {[PSCustomObject]@{Name=$_.Fullname;Size=(get-childitem $_ -recurse | % length | measure -sum | % sum | % {$_/1MB})}} | where size -lt 100 | % {Remove-Item -Recurse -Force $_.name} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment