$bytes = Write-Output 49 13 50 13 51 13 52 13 53
[IO.File]::WriteAllBytes("cr.txt", $bytes)
Get-Content -Raw cr.txt
1
2
3
4
5
5
Windows 10 / PowerShell 7.0.0-rc.1
It is not a bug in Get-Content. Rather, the carriage return characters are output to the console, which then moves the cursor back to the beginning of the line and starts overwriting previous output.
PS C:\> "eight`rr"
right
Most helpful comment
It is not a bug in Get-Content. Rather, the carriage return characters are output to the console, which then moves the cursor back to the beginning of the line and starts overwriting previous output.