【发布时间】:2011-04-12 22:49:06
【问题描述】:
$xmlFile = "D:\ServiceConfiguration.cscfg"
[xml]$doc = Get-Content $xmlFile
$node = $doc.SelectSingleNode("/ServiceConfiguration/Role/ConfigurationSettings[@name='DiagnosticsConnectionString']")
$node.value = "New-Value"
$doc.Save($xmlFile)
SelectSingleNode 总是返回 null。请帮忙
【问题讨论】:
-
您的 XPath 错误或 cscfg 文件中使用了命名空间。没有输入文件很难回答..
标签: c# .net powershell