Is there any way I can update my XML file using PowerShell:
My Current file format:
<?xml version="1.0"?>
<Configuration>
<SPaths>
<path>Share</path>
</SPaths>
My output should be:
<?xml version="1.0"?>
<Configuration>
<SPaths>
<path>My Share</path>
<path>My Share/xyz</path>
<path>My Share/abc</path>
</SPaths>
I am using the below commands
$myXML = [xml](Get-Content 'C:\MyPath.config')
$myXML.Configuration.SPaths.path = "My Share"
$myXML.Save("C:\MyPath.config")
I need to add 2 more lines of code, Any Help much appreciated, Thank you.