In my experiences you have to write to the file every single time you replace a value. The only way to avoid doing this is to create a file stream object that allows you to open the file for writing.
I also have never had any problems with the ".Replace" method being case sensitive.
NewContent = $Content | % { $_.Replace('mdt-01', 'replacethis') | Out-File $FilePath -Force -Append}
Using FileStream instead
http://blogs.technet.com/b/heyscriptingguy/archive/2005/02/08/how-can-i-find-and-replace-text-in-a-text-file.aspx
-VERN