title: Comparing a file's LastWriteTime using '-eq' does not work
body: <p>I am using a PowerShell script to validate file dates on remote production servers. The check outputs a code number to our deployment tool to report either a passing or failing result to indicate if the file is correct or not.</p>
  
  <p>This works, however the only problem I have is that I cannot get the following script to work with an <code>-eq</code> and have instead used a <code>-gt</code> and put the file date in the script one day less than the actual file date. For instance, 11/17/2014 in the script to check a 11/18/2014 file.</p>
  
  <pre><code>$FileExe= Get-ChildItem "C:\filepath\file.exe" |
      Where-Object {$_.LastWriteTime -gt "11/17/2014"} | Out-String
  
  if($FileExe){Write-Host '0'} else{Write-Host '4';Exit 4}
  </code></pre>
  
  <p>Assuming the file is the correct 11/18/2014 file, this will output a 0, indicating it passes. If not, then it outputs a 4 indicating the wrong file is in place at which point I can go in and fix it.</p>
  
  <p>If I change the <code>-gt</code> to an <code>-eq</code> and change the date in the script to match the actual file date (11/18/2014 in this example), the script fails and outputs the error code. This is despite the fact the file date and date in the script is correct.</p>
  
  <p>At this point, I am at a loss. Am I doing something wrong with my script, or is there a better way to do what I am trying to do here that will allow an <code>-eq</code>?</p>