I am trying to modify config.xml
.
config.xml
content is
<command>
some lines here 2
</command>
some lines here 3
So I want to replace the content between <command>
and </command>
. Here is what I tried doing
$Replace = Get-Content D:\Temp\Replace.txt
$ReplaceWith = Get-Content D:\Temp\ReplaceWith.txt
$regex = '(<command>\d*).*?(</command>\d*)'
$Replace -replace $regex, $ReplaceWith
But its not working. Need help.