Powershell XML importnode from different file

前端 未结 1 902
旧时难觅i
旧时难觅i 2020-12-20 19:22

Content of profile.xml:


  
    

        
相关标签:
1条回答
  • 2020-12-20 19:54

    You're really close but ImportNode only makes a copy and doesn't actually insert the copied nodes into the document. Try this:

    $newNode = $newxml.ImportNode($xml.get_DocumentElement(), $true)
    $newxml.DocumentElement.AppendChild($newNode)
    $xml.Save("$pwd\profile.xml")  
    
    0 讨论(0)
提交回复
热议问题