<?xml version="1.0" encoding="utf-8"?>
<Test1>
<Test1Properties>
<Property1>replace this</Property1>
</Test1Properties>
<Test1Sources>
<Source1>
<SourceReference>sourceref</SourceReference>
<SourceType>None</SourceType>
</Source1>
<Source2>
<Source2Properties>
<Provider>prov</Provider>
<ProviderKey>some-guid</ProviderKey>
</Source2Properties>
</Source2>
</Test1Sources>
</Test1>
Given the xml above, there are 3 tasks that I need to accomplish in Powershell:
- Replace the value of <Test1><TestProperties><Property1> with new-value
- Verify that <Test1><TestSources><Source1><SourceType> value = None
- How to determine if <Test1><Test1Sources><Source2><Source2Properties> exists within <Source2>
I'm assuming reading into an xml variable is the best way to start? Like:
[xml]$xmlAttr = Get-Content -Path TestFile.xml
I hardly use Powershell at all much less with XML, so hoping these are fairly straightforward asks. Thanks in advance.