I am working on writing a PowerShell script to auto-upgrade the installed components. The config details of the file are stored in an XML file. Since there is interdependence in the variables the variables are defined as below.
<root>
<variable name="APP_NAME", value="My App" />
<variable name="INSTALL_PATH", value="some folder/${APP_NAME}" />
<variable name="PRODUCT_HOME" value="${INSTALL_PATH}\productinfo\${APP_NAME}" />
<root>
When I read the XML file I want to get the value of $INSTALL_PATH as some folder/My App instead of some Folder/${APP-NAME}. And the value of APP_NAME changes after few steps and I have to re-parse the XML file again.
What would be the best way to do it?
I thought of reading the XML file and creating PowerShell variables for every variable in the XML file and when I have to re parse the XML file I will change the values of variables.
Is there any better way of achieving this?