Deleting an xml element

Welcome Forums General PowerShell Q&A Deleting an xml element

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
1 year, 6 months ago.

  • Author
    Posts
  • #71969

    Participant
    Points: 1
    Rank: Member

    I have an example of a xml format,....with that I would like to remove the element listed as

    How can I remove that one element? Thank you for any help.

  • #72004

    Participant
    Points: 0
    Rank: Member

    The post seems to removed a very crucial part of your question. With that said, is seems you just want to know how to remove an element. The below should help. In this example I am removing all Virtual Computer elements from the XML

  • #72007

    Participant
    Points: 0
    Rank: Member

    Results:

  • #72056

    Participant
    Points: 24
    Rank: Member

    The easiest way is to select that one XML node, and then:

    $node.parentnode.removechild($Node)
    

    David F.

The topic ‘Deleting an xml element’ is closed to new replies.