XML : Using PowerShell, what's the shorest way to add a child three levels deep?

Given the following XML:

  <greatGrandParent>  </greatGrandParent>    

I want to end up with:

  <greatGrandparent>    <grandparent>      <parent>        <child />      </parent>    </grandparent>  </greatGrandparent>    

In PowerShell, what's the easiest way to add the last node (child)? Can it be done using just the path /greatGrandarent/grandparent/parent/child? Can it be done without getting greatGrandparent, appending grandparent, appending parent to grandparent, etc.?

No comments:

Post a Comment