OK, I'm feeling like a really big idiot here. I've been working with Powershell for a little while more for administrative purposes at work. That said, scripting is not my strong suit.
Right now, I'm trying to write a PS script to add a section to an XML on a bunch of machines to add settings to workaround an issue we've been having with a certain application
The XML file looks as follows
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<add Name="testdata"/>
</configSections>
<connectionStrings>
<add Name="testdata"/>
</connectionStrings>
<ProvidersConfiguration>
<Providers>
<add Name="testdata"/>
</Providers>
</ProvidersConfiguration>
<FacadeSettings>
<Providers>
<add Name="testdata"/>
</Providers>
</FacadeSettings>
</configuration>
now, I've been googling and searching for hours and there's something i'm just not getting. because i can load the file in my script, navigate all the settings, even modify existing values, but that's not what I need to do.
I need to add a section like this
<NewSettings>
<add Name="setting"/>
</NewSettings>
so that my config file looks like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<add Name="testdata"/>
</configSections>
<connectionStrings>
<add Name="testdata"/>
</connectionStrings>
<ProvidersConfiguration>
<Providers>
<add Name="testdata"/>
</Providers>
</ProvidersConfiguration>
<FacadeSettings>
<Providers>
<add Name="testdata"/>
</Providers>
</FacadeSettings>
<NewSettings>
<add Name="setting"/>
</NewSettings>
</configuration>
it's the NewSettings section I can't figure out and I'm sure that when I wrap my head around it, I'll go "OH...", but right now I'm banging my head on the wall and could use some help