Skip to content

Instantly share code, notes, and snippets.

@stanwu
Last active November 1, 2020 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stanwu/96d56e553412444e823cc221bf0a1058 to your computer and use it in GitHub Desktop.
Save stanwu/96d56e553412444e823cc221bf0a1058 to your computer and use it in GitHub Desktop.
Find zero byte files then delete
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