首先,请原谅我糟糕的英语:)
我对的语法有点头疼Get-Content -Replace
我的代码是:
(Get-Content $env:HIS_XMLPATH) -replace '<Password>(.*?)</Password>', '<Password>$env:HIS_PWD</Password>' | Set-Content C:\test.xml
xml文件中的结果是:
<Password>$env:HIS_PWD</Password>
我只想要我的环境变量的值,包含它的语法是什么?
非常感谢