Pergunta

So according to the docs I should be able to do:

$ns = @{ns=$curNode.NamespaceURI}
$node = $curNode.SelectSingleNode('ns:tagName', $ns)
$node.value = '2'

to get the tagName node under the current curNode. But I get:

Cannot find an overload for "SelectSingleNode" and the argument count: "2".

So how do I go about getting to my child node to change its value?

If I just try

$node = $curNode.SelectSingleNode('tagName')

Then the $node is $null.

Foi útil?

Solução

To change the value of an XmlElement node:

$curNode.'#text' = 2
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top