PowerShell XML update Attribute Value in a Loop

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of StackExchangeUser2 StackExchangeUser2 1 year, 8 months ago.

  • Author
    Posts
  • #27645
    Profile photo of StackExchangeUser2
    StackExchangeUser2
    Participant

    Below is the XML i am working on to Update the attribute VALUE based on the Parant Node DESCRIPTION Value..

    For Parant Node "FRUITS DESCRIPTION ="MANGO"". I have to Update VALUE =".log" to VALUE ="MANGO.log"

    For Parant Node "FRUITS DESCRIPTION ="pineapple"". I have to Update VALUE =".log" to VALUE ="pineapple.log"

    How to achive the same using powershell..

    I have a problem in the loop...

  • #27679
    Profile photo of Don Jones
    Don Jones
    Keymaster

    It's "parent."

    Without seeing any code, and some of the actual XML, it's impossible to tell you what you're doing wrong. Please note that you can't post XML directly in the forums. I'd suggest creating a GitHub Gist with your XML, and then pasting the Gist URL here in the forums.

  • #27747
    Profile photo of StackExchangeUser2
    StackExchangeUser2
    Participant

    Don,
    Thanks for the response please find the below link ....

    https://etltechsolutions.wordpress.com/2015/07/22/powershell-working-with-xml/

    Hope this will help to understand what i am looking for.

    Thanks for your time...

You must be logged in to reply to this topic.