I need to read below xml file and store it in hash table.
<?xml version="1.0"?>
<ConfigValues>
<Dev>
<item Key="dbconn" Value ="Data Source=xlvxdev.cumulus.com,1615;Initial Catalog=FPTR_XLVX;Security=true;"/>
</Dev>
<QA>
<item Key="dbconn" Value ="Data Source=xlvxqa.cumulus.com,1615;Initial Catalog=OPSR_CVRC;Security=true;"/>
</QA>
<PP>
<item Key="dbconn" Value ="Data Source=xlvxpreprd.cumulus.com,1615;Initial Catalog=OPSR_CVRC;Security=true;"/>
</PP>
<PROD>
<item Key="dbconn" Value ="Data Source=xlvxprd.cumulus.com,1615;Initial Catalog=OPSR_CVRC;Security=true;"/>
</PROD>
</ConfigValues>
I tried writing below powershell and able to get the attributes key value but I need to store it on the hashtable so that I can retrieve the value as needed.
$URLS = [xml](Get-Content 'C:\Desktop\Variables.xml')
$URLS.ConfigValues.Dev.item | where {$_.key -eq 'connCVRC'}
Key Value
--- -----
connCVRC Data Source=xlvxdev.cumulus.com,1615;Initial Catalog=FPTR_XLVX;Security=true;
$xml.ConfigValues.Dev.Item.Value.Split(';') | ConvertFrom-StringData? Please add an expected result to your question.