Last active
November 1, 2020 03:40
-
-
Save stanwu/96d56e553412444e823cc221bf0a1058 to your computer and use it in GitHub Desktop.
Find zero byte files then delete
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 -Recurse | foreach-object { | |
if(!$_.PSIsContainer -and $_.length -eq 0) { | |
write-host (“{0} -> {1}” -f $_.FullName, $_.Length) | |
remove-item -path $_.FullName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment