Read XML file to populate Deploy-Application variables

//Read XML file to populate Deploy-Application variables
Read XML file to populate Deploy-Application variables 2017-10-30T05:40:47+00:00

The Toolkit Forums General Read XML file to populate Deploy-Application variables

  • Author
    Posts
  • Joe-Z
    Participant
    Post count: 2
    #2383 |

    Hi,
    I haven’t come across this topic being asked yet (I hope) but I am looking to extend the toolkit so that Deploy-Application reads content from an XML file and set the variables in VARIABLE DECLARATION based on the values.

    The idea is for another system to generate the XML file based on requester’s input, then a new package is created. Simple installers may not need further work than this, but for the complex ones, it should cut some time down.

    I’ve played with the Get-Content cmdlet above the variables but it seems that the values are not being read and appear empty.

    If there is another idea to achieve what I’m trying to accomplish, please share! Otherwise, how do I accomplish the above?

  • Jim
    Participant
    Post count: 43

    I’ve used the functions available on this site, http://blog.danskingdom.com/powershell-functions-to-get-an-xml-node-and-get-and-set-an-xml-elements-value-even-when-the-element-does-not-already-exist/, to read/modify XML files. Maybe they will help you…

    I’ve actually added those functions to the AppDeployToolkitExtensions.ps1 file so I can use them anytime I need them…

  • Joe-Z
    Participant
    Post count: 2

    Great, thank you! I’ll have a look. I’m new to app packaging and PSADT so this might take me some time to get familiar.

You must be logged in to reply to this topic.