title: Powershell script to check for a file that was created on the date of today
body: <p>I am writing a script for my company. One of the goals of this script is to check in a directory if a File was created today. It should then return the message that the File exists or the file does not exist in case there is no file that was created today. Below you can see how far I have gotten. I have also already experimented with the Test-Path command but had no success.</p>
  <pre><code>$FOUND = $True
  
  $dir = &quot;directory path&quot; #Cant put the real directory path in here out of security reasons
  
  $latest = Get-ChildItem -Path $dir | Where-Object {$_.CreationTime -gt (Get-Date).Date}
  
  if($Path -eq $FOUND) {
      Write-Host 'File exists'
  }
  else {
      Write-Host 'File does not exist'
  }
  </code></pre>
  <p>I have also tried with an if-else statement.</p>
  <p>Hope you can help
  Thanks</p>