I am reading a event log using a Powershell command like the 1 below:
get-winevent -Path "C:\Test.evtx" -oldest | convertto-xml -as Stream > "C:\Test.xml"
As you can see, I am storing the result in a XML file for later reading.
For few events in the event log, I need a special query as follows:
$evtWithoutMsg = get-winevent -Path "C:\Test.evtx" | Where-Object {($_.RecordId -eq 53593)}
$xmlThing = [xml]$evtWithoutMsg.toxml()
$msg = $xmlThing.Event.EventData.Data
$msg
My question is can I have this '$xmlThing.Event.EventData.Data' as a new node or something in the xml file output (test.xml) of the initial command?