Change XML Element value with PowerShell

When I run:

$filePathToTask = "C:\temp\Task.xml"
$xml = New-Object XML
$element =  $xml.SelectSingleNode("//Arguments")
$element.InnerText = "New Text"

And re-check the output, I do see the updated value:

  <Actions Context="Author">
      <Arguments>New Text</Arguments>

I enclosed the path in quotes, otherwise I was getting an error on the load line. That's good practice anyway, since the parameter for the Load method takes string filepath as input. Then as Ansgar mentions, use the assignment operator ("=") to set the new value in memory, then dump to file.

InnerText is a property, not a method. It's used like this:

$element.InnerText = "newtext"

Also, I suspect that your original data (unlike the XML sample you posted) uses namespaces. AFAICS that's the only possible reason why $xml.SelectSingleNode('//Arguments') would return an empty result. XML files exported from the Windows Task Scheduler definitely are namespaced:

<Task version="1.2" xmlns="‌​">
  <!-- ... -->

Namespaces are not like other node attributes and affect not only the node itself, but also its child nodes. For selecting nodes from an XML with namespaces you need a namespace manager:

$nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable)
$nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI)
$element = $xml.SelectSingleNode('//ns:Arguments', $nsm)