title: Compare objects in an if statement Powershell
body: <p>I'm trying to compare two files and if their content matches I want it to preform the tasks in the if statement in Powershell 4.0</p>
  
  <p>Here is the gist of what I have:</p>
  
  <pre><code>$old = Get-Content .\Old.txt
  $new = Get-Content .\New.txt
  if ($old.Equals($new)) {
   Write-Host "They are the same"
  }
  </code></pre>
  
  <p>The files are the same, but it always evaluates to false. What am I doing wrong? Is there a better way to go about this?</p>