Kate answered this question. I just wanted to add more information because I found it useful many times. Take a look at the code:
[21]: function test{ >> $args -replace '`n',"`n" >> } >> [22]: test 'replace all`nnew' 'lines`nin the `nstring' 'eof`ntest' replace all new lines in the string eof test
The -replace operator also works with an array!
source share