I have to replace a string within a file with contents from a different file BUT I need to keep the linebreaks. The original file has text before and after the insertion spot.
I am trying to do this with the code below:
$v_notes = Get-Content -path $cp_file_temp_rep
$file = Get-Content -path $ip_file_template |
ForEach-Object {
$line2 = $_
$line2 -replace "placenoteshere", $v_notes |
}
Set-Content -Path $op_file_replaced -value $file
Maybe adding the lines from the $v_notes into $file works, but I just don't get how to achive this.