Hi All,
I am writing a PowerShell wrapper for an existing Perl script. The Perl script is fed a couple of parameters and goes off and configures all our HP iLO devices for us, and returns the results in an XML format. The problem is the result comes out as one big blob of multiple XML statements ie:
$strResult = & "perl locfg.pl -s $iloInterface -f $configXML"
<?xml version="1.0"?>
<RIBCL VERSION="2.22"/>
<RESPONSE
STATUS="0x0000"
MESSAGE='No error'
/>
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.22"/>
<RESPONSE
STATUS="0x0000"
MESSAGE='No error'
/>
</RIBCL>
etc.
Attempting to then cast the $strResult
to XML results in Error: "There are multiple root elements
Does anyone have any thoughts on how I can split up these XML statements in PowerShell to make them valid? I was thinking maybe a "dummy" root element may be in order? Or should I be looking at tweaking the underlying Perl script?