title: Get-WinEvent used to export .evt file. But can't open the evt file in Event Viewer - File corrupted message
body: <p>I have made a Powershell script to extract the Application &amp; System logs from remote servers in different domain. Script works perfectly! However, I am having issues with the exported file. When I try to open the log file in event viewer, I get a message saying that the <strong>log file is corrupted and unreadable</strong>. Below is a part of the script:</p>
  
  <pre><code>$apppath = "\\server01\D$\temp\Automated_Logs\applog_" + $server + ".evtx"
  Get-WinEvent -FilterHashtable @{ logname = 'Application'; StartTime = $start; EndTime = $end } -ComputerName $server -Credential $c | Out-File -FilePath $apppath 
  </code></pre>
  
  <p>Server OS: Windows Server 2003/2008</p>