Link to home
Start Free TrialLog in
Avatar of ndr-itsolutions
ndr-itsolutions

asked on

Powershell and Quoting rules

I need to pass a variable into the following command, but I can't get it to work:

Get-Content E:\web.config ) | ForEach-Object {$_ -replace '<add key="DataSource" value="TEST_xxx" />', '<add key="DataSource" value="TEST_$num" />'} | Set-Content E:\web.config

Open in new window


$num is defined as LOT1

Any ideas ?
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial