I have the following XML & I'm trying to obtain the value corresponding to Name=ComponentVersion.
<Component .......>
<Settings>
<Setting Name="ComponentVersion" Value="12345" />
<Setting Name="Host" Value="false" />
</Settings>
<Jobs>
<Job Name="Platform" />
</Jobs>
</Component>
Here's what i have tried..
$fullPathXML = "$env:PackagesPath\Platform\Components\SystemPlatform.Comp.xml"
[xml]$xmlSystemPlatform = Get-Content $fullPathXML
$xmlSystemPlatform.selectNodes('//Settings/Setting') | select Name
Select-Xml '//Settings/Setting[contains(@Name, "ComponentVersion")]' $xmlSystemPlatform |%{$_.Node.Value}
$xmlSystemPlatform.Settings.Setting[0].Name
$xmlSystemPlatform.Settings.Setting[0].Value
How do I get the value for Name corresponding to ComponentVersion?
No comments:
Post a Comment