If I replace just the text there is no problem but the problem occurs when I replace the text that includes backslashes that is when the error occurs. How can I approach this to accept the new parameter? Here is what I have:
(Get-Content 'C:\TEST.txt' -Raw) -replace 'Log', 'Log\400\Department3' |
Set-Content -Path 'C:\TEST.txt'