Search code examples
powershellcarriage-return

Powershell - Carriage returns inserted in output when I use '>'


How do I stop this command from dumping carriage returns into my output:

get-content inFILE | select-string "string" > outFILE

Text that was non-wrapped or lacking carriage return suddenly has a carriage return at the 80th character per line. Is there a directive I can use to stop it from doing this to my output?


Solution

  • Use set-content instead of > ( which is same as out-file)