Hi I am trying to change the content of a file through Powershell but its not working:
$mf_runw_user = 'abc'
$mf_runw_pass = facter -p mf_runw_pass
$run_path = "D:\MF_Dashboard\NMFD\Runway\Web.config"
(Get-Content "$run_path").replace('"USERID" value="*"', '"USERID" value="$mf_runw_user"') | Set-Content "$run_path"
(Get-Content "$run_path").replace('"PASSWORD" value="*"', '"PASSWORD" value="$mf_runw_user"') | Set-Content "$run_path"
Basically I need the below output:
<add key="USERID" value="abc" />
<add key="PASSWORD" value="123qweasd" />
but i am getting this output:
<add key="USERID" value="$mf_runw_user" />
<add key="PASSWORD" value="$mf_runw_pass" />
Please Help me on this.