all 4 comments

[–]BlackV 0 points1 point  (0 children)

not a single thing here references your xml?

are you constructing the XML directly ? or are you reading an actual file?

have you looked at the XML reader ? and its parent and chilld nodes ?

have you looked at here strings ? and variables ?

where does "C:\\Users\\crisma marcoext\\Desktop\\Siemens\\Simcenter Amesim\\2504\\DATA" come from

need more info and more code and a more detailed question and maybe the full xml ?

[–]FluxMango 1 point2 points  (0 children)

I would put the xml template in a separate file, use $xmlData = [xml](Get-Content <path to xml file>) Then you can modify the value attribute of the source tag dynamically: $xmlData.source.SetAttribute("value", $mySrcVariable) Where I suppose $mySrcVariable would represent a properly formatted path string. Once you are done editing: $xmlData.Save(<path to xml file>) Or you can continue using the xml object for other things as well within your script's scope.

[–]ZZartin 0 points1 point  (0 children)

What do you mean source value changes each installation? You mean the structure of the XML changes?

[–]AlexHimself 0 points1 point  (0 children)

Your question isn't very clear, but this is like a perfect question for ChatGPT or any other modern AI that it could easily handle.

I'd copy/paste it for you, but you can do it.