Say I have the following XML in a variable called "$myxml"... ...How do I add (an set the value of) an element at, say, Many Thanks, =Adrian=
Try this: $xml =3D [xml]@" $i =3D $xml.CreateElement('item03') $i.InnerText =3D 'this is test' $node =3D Select-Xml -Xml $xml -XPath /root/firstlevel02 | select -exp Node $node.AppendChild($i) > $null $xml | Format-Custom $xml.root.firstlevel02