Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

need help on -replace with double quote

$
0
0

Hello,

 

the following code is not working due to the dot (.) :

 

$configFiles=get-childitem . *.xml -rec

foreach ($file in $configFiles)

{

(Get-Content $file.PSPath) |

 Foreach-Object {$_ -replace '"Product"."Details"','"Product"."Details123"'`
  -replace '"Market"."Details"','"Market"."Detailsxyz"'}|
 Set-Content $file.PSPath
}

can I have any clue to solve this or any other code to make my -replace code works effectively


Viewing all articles
Browse latest Browse all 8583

Trending Articles