access #text property of XMLAttribute in powershell
问题 I have an xml document formated like this: <root> <obj> <indexlist> <index name="NUMD" value="val1" /> <index name="DATE" value="val2" /> </indexlist> </obj> </root> now I'd like to change the value attribute of the index element where name is set to "DATE". I get the attribute like this: $attr = $xml.selectnodes("//obj/indexlist/index[@name='DATE']/@value") I can view the value by typing this: $attr.'#text' but I can't change it: $attr.'#text' = 'foo' The property '#text' cannot be found on