title: Get name or path of folder if it's empty
body: <p>I am working on a script, that checks if there is a txt-file inside every subfolder. That works fine, but how is it possible to get the name of the subfolder, if there is no txt-file in it?</p>
  
  <p>For example: Inside "C:\Files\" I have some subfolders A, B, C and D. Inside these subfolders, there is just one txt-file, generated and placed from another software. These files are replaced every day with a new txt-file. </p>
  
  <p>Sometimes one or more files are missing, so the subfolder is empty. How do I get the foldername, if the folder contains no txt-file?</p>
  
  <p>My code:</p>
  
  <p>Check if file from yesterday exists</p>
  
  <pre><code>$yesterday = Get-ChildItem C:\Files\*.txt -Recurse | Where-Object {
      $_.LastWriteTime.ToShortDateString() -eq (Get-Date).AddDays(-1).ToShortDateString()
  }
  </code></pre>
  
  <p>When file is missing:</p>
  
  <pre><code>if (!$yesterday) {
      Send-MailMessage 
          -To $mailReceiver 
          -Cc $mailReceiverCc 
          -From "$mailSenderName $mailSender" 
          -Subject "Backup error" 
          -Body "Backup from yesterday is missing!" 
          -SmtpServer $mailSmtpServer
  }
  </code></pre>