Quantcast
Channel: How to update an Xml Element value using PowerShell
Viewing all articles
Browse latest Browse all 6

How to update an Xml Element value using PowerShell

$
0
0
With a little bit of an XPath magic, you can do the following:

$x = Select-Xml -Path c:\test.xml -XPath '//column[last()]'

$x.Node.'#text' = "foo"

$x.Node.OwnerDocument.Save($x.Path)



Aleksandar Nikolić http://powershellers.blogspot.com http://twitter.com/alexandair

Viewing all articles
Browse latest Browse all 6

Trending Articles