如何从指定目录中获取多个XML文件的列表,并且为每个文件使用powershell在第二个根节点下添加一个元素?使用powershell编辑多个XML文件
例子: 我想第一<Names>
元素中添加<LastName>SomeName</LastName>
:
<People>
<Names>
<FirstName>someFirstName</FirstName>
</Names>
<Names>
<FirstName>myFirstName</FirstName>
<Address>SomeAddress</Address>
</Names>
</People>
将变为:
<People>
<Names>
<LastName>SomeName</LastName>
<FirstName>someFirstName</FirstName>
</Names>
<Names>
<FirstName>myFirstName</FirstName>
<Address>SomeAddress</Address>
</Names>
</People>
在PowerShell中您可以使用的唯一工具? – ghostdog74 2010-02-24 09:37:15
不,powershell不是我可以使用的唯一工具。只是认为这将是最容易使用。你能推荐别的吗? – Draco 2010-02-24 11:06:19