After running the code below:
$xml = [xml](Get-Content Y:\SCOMLast24Hrs.xml)
$eventXML = [xml](Get-WinEvent -FilterXml $xml -ComputerName servername -MaxEvents 1).ToXML()
I get the needed data:
p_StateChangeEventProcess – (BaseManagedEntityId=f2e7c97e-0f85-bf5e-e2c7-ec1aae440a8f), (EventOriginId=75a0ca4e-b722-453c-b6a0-e19899bfb1d3), (Monitor
Id=f1baeb56-8cce-f8c7-79ae-d69796c9d926), (NewHealthState=3), (OldHealthState=1), (TimeGenerated=8/26/2015 5:50:17 PM), (Context=), (RETURN_VALUE=0)
However, I would like to further parse the returned data. I would like to pull out the name=value pairs from with each set of parentheses separated by a comma, but haven’t quite gotten what I want.
Regex? ConvertFrom-String? Something else?
I will the convert the GUID in human readable strings using the SCOM shell commands.