In our Remote Management System we can execute HPiLOcmdlets to retrieve data from the iLO hardware management card in a HP Server.
Example:
$tempstatus = Get-HPiLOTemperature -Server $server -Username $Username -Password $Password -Output XML
This will generate an XML file, that i want to use as input and output as a table in Powershell
Input XML:
<?xml version="1.0" encoding="UTF-8"?>
<RIBCL VERSION="2.23">
<TEMPERATURE>
<TEMP>
<LABEL VALUE="01-Inlet Ambient" />
<LOCATION VALUE="Ambient" />
<STATUS VALUE="0K" />
<CURRENTREADING VALUE="23" UNIT="Celsius" />
<CAUTION VALUE="42" UNIT="Celsius" />
<CRITICAL VALUE="46" UNIT="Celsius" />
</TEMP>
<TEMP>
<LABEL VALUE="02-CPU 1" />
<LOCATION VALUE="CPU" />
<STATUS VALUE="0K" />
<CURRENTREADING VALUE="40" UNIT="Celsius" />
<CAUTION VALUE="70" UNIT="Celsius" />
<CRITICAL VALUE="N/A" />
</TEMP>
<TEMP>
<LABEL VALUE="03-CPU 2" />
<LOCATION VALUE="CPU" />
<STATUS VALUE="0K" />
<CURRENTREADING VALUE="49" UNIT="Celsius" />
<CAUTION VALUE="70" UNIT="Celsius" />
<CRITICAL VALUE="N/A" />
</TEMP>
</TEMPERATURE>
</RIBCL>
So far i tried :
[xml]$XmlDocument = get-content test.xml
$XmlDocument.RIBCL.TEMPERATURE.ChildNodes | Format-Table
Result:
Wanted output:
Thanks for any help !!!

