title: Powershell csv delete row
body: <p>I'm trying to delete rows from csv base off certain conditions in two columns. Status column if it has T and the second column is Term Date if the date is older then the past 5 days.</p>
  <p>little info column STATUS has either &quot;A&quot; or &quot;T&quot;.</p>
  <pre><code>$path = &quot;data.csv&quot;
  $maxAge = (Get-Date).AddDays(-5).Date
  Import-Csv $path | Where-Object {$_.STATUS -eq &quot;A&quot; -or $_.TERMDATE -gt $maxAge} | 
  Export-Csv -Path temp.csv -NoTypeInformation
  </code></pre>
  <p>it works to a certain degree, but still shows dates from last year.</p>