title: Date Time day of the week comparison logic in PowerShell
body: <p>Date Time objects allow us to perform actions like this:</p>
  
  <pre><code>$CurrentDate = Get-Date
  $TextDate = get-date -date "02/10/2016"
  
  if ($TextDate -lt $CurrentDate){
      Write-Host "True"
  }
  else {
      Write-Host "False"
  }
  </code></pre>
  
  <p>This outputs "True" because $TextDate is less than $CurrentDate.</p>
  
  <p>Following the same logic, why does the following code output false?</p>
  
  <pre><code>$CurrentDate = Get-Date -UFormat %V
  $TextDate = Get-Date -date "02/10/2016"
  $TextDate = Get-Date -date $TextDate -UFormat %V
  
  if ($TextDate -lt $CurrentDate){
      Write-Host "True"
  }
  else {
      Write-Host "False"
  }
  </code></pre>
  
  <p>The only difference is that we are comparing the week of the year. If you change the comparison to <code>-gt</code>, the code returns True.</p>