title: Copying files if creation date is greater than last backup
body: <p>I am having some issues with a script I have written - I am trying to get this portion of the script to loop through and find any files where the creation date is greater than the last time we ran a backup.</p>
  
  <pre><code>$auditDate = (Get-Date).AddDays(0)
  $lastAudit = Get-Content $auditLog | Select-Object -last 1
  $desDir = "E:\Backup\"
  $srcDir = "C:\\Data"
  
  foreach ($file in Get-ChildItem $srcDir)
  {
      if ($file.CreationTime.Date.toString("dd/MM/yyyy") -gt $lastAudit)
      {  
          Copy-Item $file.FullName $desDir
      }
      {
      }
  }
  </code></pre>
  
  <p>At the moment when I run the script I am getting all the files in the folder copied across.</p>
  
  <p>Any ideas?</p>