title: Compare dates from a string in PowerShell
body: <pre><code>$Deldate = "19-06-2018"
  $Newdate = "04-06-2018"
  </code></pre>
  
  <p>I need to check which date is bigger.</p>
  
  <pre><code>if ($Deldate -ge $NewDate) {
      write-host "NewDate is bigger"
  } 
  else {
      write-host "Deldate is bigger"
  }
  </code></pre>
  
  <p>This is not working for me, and it looks like the format is not "System.DateTime". I'm getting the date values are from an external CSV file. How do I find a solution for this?</p>