我正在尝试使用Powershell在XML的ArrayOfString中插入项目,但没有任何结果。我正在使用XPath和.SelectSingleNode
。不幸的是.Add
不起作用,因为大小是固定的。
如果我使用的是.CreateElement
和.AppendChild
XML示例为:
<Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Records>
<Entry>
<Key>Items</Key>
<Value xsi:type="ArrayOfString">
<string>Item1</string>
<string>Item2</string>
</Value>
</Entry>
<Entry>
<Key>SomeOtherKey</Key>
<Value xsi:type="xsd:string">SomeOtherValue</Value>
</Entry>
</Records>
</Content>