I'm trying to replace a string with another string and also add a line-break character, but I can't figure out the correct syntax. Here's a simplified example:
'first@second' -replace ('(fi.*t)@', "$1`n")
Result:
second
I then tried:
'first@second' -replace ('(fi.*t)@', '$1`n')
Result:
first`nsecond
It looks I can either have a line-break or a back-reference, but not both. What do I need to change to get both? What I want is:
first
second