title: PowerShell to filter file size
body: <p>I am trying to write a script using PowerShell to get file size 0kb as mentioned below </p>
  
  <pre><code>$FileExists1 = 'C:\Users\iskandar\Desktop\TEST\*\test0700.txt'
  
  IF (Test-Path $FileExists1) {
      If ((Get-Item $FileExists1).length -gt 0kb) {
        Write-Output "All file size is good!"
      }
  
  Else {
        Write-Output " There is a file with 0KB, Please inform support staff"
      }
  }
  </code></pre>
  
  <p>if there is multiple folder with multiple file, the script not filter the 0KB file. </p>
  
  <p>for example : lets say I have 30 files and only one file with 0KB, when I run those script, it shows "All file size is good!". </p>
  
  <p>Can anyone advice?. Thank you </p>