【发布时间】:2010-07-08 10:13:53
【问题描述】:
如何更改节点的值
<Test><b>Test</b></Test> 到
<Test><b>Power</b></Test>?
示例:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="DeploymentDate" value="test" />
<add key="DateOfInitialization" value="Vinoj" />
</appSettings>
<Test>Test</Test>
</configuration>
这是我目前使用的 PowerShell 脚本:
$configuration = "app.config"
[xml]$xml = New-Object XML
$xml.Load($configuration)
$xml.selectnodes("/configuration/Test") = {"UST"}
$xml.Save($configuration)
【问题讨论】:
标签: powershell