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
Here is the gist of what I have:
$old = Get-Content .\Old.txt
$new = Get-Content .\New.txt
if ($old.Equals($new)) {
Write-Host "They are the same"
}
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?