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

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -