我想使用正则表达式脚本函数更新这两个字段(客户端和环境)
<authentication mode="Forms">
<forms name="AIR.client.environment.value" loginUrl="Login.aspx" protection="All" timeout="30" />
</authentication>
我拥有的功能
$regex_clientname = new-object System.Text.RegularExpressions.Regex("client=.*", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase);
$regex_enviorenment = new-object System.Text.RegularExpressions.Regex("environment=.*", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase);
$root.SelectSingleNode("//authentication/forms/@name")."#text"=$regex_enviorenment.Replace($regex_clientname.Replace($root.SelectSingleNode("//authentication/forms/@name")."#text", $CLIENT),$ENV);
但它没有更新..我需要帮助