Why Get-Content Ain't Yer Friend
Well, it isn’t your enemy, of course, but it’s definitely a tricky little beast.
Get-Content is quickly becoming my nemesis, because it’s sucking a lot of PowerShell newcomers into its insidious little trap. Actually, the real problem is that most newcomers don’t really understand that PowerShell is an object-oriented, rather than a text-oriented shell; they’re trying to treat Get-Content like the old Type command (and why not? type is an alias to Get-Content in PowerShell, isn’t it?), and failing.
Worse, PowerShell has just enough under-the-hood smarts to make some things work, but not _everything. _
For example, this works to replace all instances of “t” with “x” in the file test.txt, outputting the result to new.txt:

