Editing XML Content in powershell -
i have following xml document want edit through power shell.
<wda.application.configuration xmlns="wda.application.configuration"> <portals> <portal portalid="abcd" type="default" /> </portals> <configsections codebase="c:\wda.applications\wda.net\assemblies\private"> </configsections> i want edit -portalid value , in ->codebase.i returniing xpath of these 2 elements,but on calling document.selectsinglenode(xpath) on these,i getting null node.
the xpath having of type /wda.application.configuration/portals/portal can 1 please tell me how can edit these nodes.
hope helps:
[xml]$xml = (gc c:\test.xml) $xml.item("wda.application.configuration").portals.portal.portalid = "newid"
Comments
Post a Comment