title: Powershell get row older than 30 days and export them into another csv file
body: <p>I have a csv file as per below format and i want to export row which is older then 30 days</p>
  <pre><code>Target;Date;Safe
  Box11;01/10/20;abc_test1
  Box2;02/10/20;xyz_test2
  Box3;03/10/20;mnp_test3
  Box2;01/09/20;xyz_test2
  Box3;02/09/20;mnp_test3
  Box11;03/09/20;abc_test1
  </code></pre>
  <p><strong>I use the script as below but failed</strong></p>
  <pre><code>$Data = Import-CSV &quot;D:\Dev\test1.csv&quot; | where { [datetime]::ParseExact($_.Date, &quot;dd/MM/yy&quot;, $null) -lt (get-date).date.adddays(-30)}
  $Data | Export-Csv &quot;D:\Dev\test1234.csv&quot;
  </code></pre>
  <p><strong>Failed reason -</strong></p>
  <blockquote>
  <p>Exception calling &quot;ParseExact&quot; with &quot;3&quot; argument(s): &quot;String was not
  recognized as a valid DateTime.</p>
  </blockquote>
  <p><strong>Expected result in a new csv file would be</strong></p>
  <pre><code>Box2;01/09/20;xyz_test2
  Box3;02/09/20;mnp_test3
  Box11;03/09/20;abc_test1
  </code></pre>