title: PowerShell Date Comparison
body: <p><strong>Goal: Import dates from CSV. If date has already passed or is today, display it.</strong> </p>
  
  <pre><code>$dayInOctober = (Get-date).AddDays(90)
  $csvname = "myCSV.csv"
  $csvFile = Import-Csv C:\Users\a341162\Desktop\$csvname
  
  foreach($row in $csvFile){
      if ($row.Date -le $dayInOctober){
          Write-Host $row.Date
      }
  }
  </code></pre>
  
  <p>But only works if I make the if statement <code>-gt</code>. Shouldn't it be the way I have it above?</p>
  
  <p>myCSV.csv: </p>
  
  <pre><code>"Name","Date"
  "admryantest2","7/20/2018"
  "admryantest3","7/20/2018"
  "admryantest3","7/23/2018"
  "admryantest3","7/23/2018"
  </code></pre>