title: Sorting a Directory before Looping Through - PowerShell
body: <p>I need to process files in order from oldest create date to newest</p>
  
  <p>Is this correct or is there a better way to do it?</p>
  
  <p>Thanks</p>
  
  <pre><code>Get-ChildItem -Path C:\Users\Tom\ -Filter "*.journal" | Sort-Object -Property CreationTime
  
  ForEach ($sourcefile In $(Get-ChildItem $source | Where-Object { $_.Name -match "Daily_Reviews\[\d{1,12}-\d{1,12}\].journal" }))
  {
      #### Process files in order from oldest to newest
      $file = $source+$sourcefile
   }
  </code></pre>