title: Get files between date range in windows PowerShell
body: <p>I'm trying to get files between a date range in windows power shell but it's getting all the files instead of just the ones in range.</p>
  
  <p>Here's my commands:</p>
  
  <pre><code>[datetime]$start = '2018-04-01 00:00:00'
  [datetime]$end = '2018-05-01 00:00:00'
  Get-ChildItem "C:\Users\PC- 1\Downloads" | Where-Object { $_.LastWriteTime -gt $start -or $_.LastWriteTime -lt $end }
  </code></pre>