title: Powershell - Correct Way of Checking if a directory is empty
body: <p>What is the correct way of determining if a file or folder is empty in powershell? I came across this <a href="https://stackoverflow.com/questions/10550128/powershell-test-if-folder-empty">post</a> and tried the example that the second user gave, and it worked.</p>
  
  <p>Now, I've been checking if a directory is empty by using the length property, like this:</p>
  
  <pre><code>(Get-ChildItem -Path "C:\Users\someUser\Downloads\" -Recurse).Length)
  </code></pre>
  
  <p>However, that only returns the number of bytes that the file/folder has. I tested the length property and found that if you were to have a blank text file/folder placed in the downloads then the length property wouldn't return the correct value.</p>
  
  <p>Can you use the length property to correctly determine the number of files/folders that a directory has? </p>