≡ Menu

Use powershell to find zero size/byte files

Below scripts helps you to find files with zero file size. Run this piece of code from root of your system from powershell window.

Get-Childitem -Recurse | foreach-object {
    if(!$_.PSIsContainer -and $_.length -eq 0) {
        write-host (“{0} -> {1}” -f $_.FullName, $_.Length)
        }
}

You can also refer to below article on how to find files older than certain size.

https://techibee.com/powershell/list-the-files-greater-than-given-size-using-powershell/163