title: Reading an .evtx file in Power Shell
body: <p>I am trying to convert an event log file (.evtx) to xml using Power Shell (and later read this xml in a C# program). I am running the script </p>
  
  <pre><code>get-winevent -Path "C:\test.evtx" -oldest | convertto-xml -as Stream &gt; "C:\test.xml"
  </code></pre>
  
  <p>but the resultant xml file has many events whose 'Message' field is EMPTY. If I open the same .evtx in Windows Event viewer, I can see messages of all events. </p>
  
  <p>Though this problem is reported and people have talked about it (<a href="http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/12467b47-c1e6-4208-bbbf-9fec9b4b8111" rel="nofollow">here</a> &amp; <a href="http://connectppe.microsoft.com/PowerShell/feedback/details/716533/get-winevent-does-not-return-the-content-of-the-event-message-in-v3-ctp2" rel="nofollow">here</a>), I am unable to find a solution / workaround for this.</p>
  
  <p>Can anyone please tell me if there is something new availlable on this issue or any information that might be helpful.</p>
  
  <p>PS: I am using Power shell version 2.0.</p>