title: Get -WinEvent - Reading From a Saved Event Log File
body: <p>Easy question, I have the following that reads the application log:</p>
  
  <pre><code>$out = @()
  $endtime=[datetime]::Today
  $starttime=    $endtime.AddDays(-10)
  $evts = get-winevent -FilterHashtable @{ logname="application"; Level= "1","2"; starttime=    $starttime;endtime=    $endtime } -maxevents 10 | select TimeCreated, Providername, id,Message
  foreach(    $evt in     $evts){
  $mess = RemoveBlankSpaces(    $evt.Message)
  $out += "    $(    $evt.ID),    $(    $evt.Providername),    $(    $evt.TimeCreated),    $mess"
  }
    $out | out-file -filepath .\warning.txt
  </code></pre>
  
  <p>How do you get it to read from a evtx file (a saved event log file)?</p>
  
  <p>TIA!</p>