title: Powershell script to extract logged errors
body: <p>I have a lot of log files that I wish to extract the distinct error message from for a specific trace writer.</p>
  
  <p>The log files are SharePoint ULS logs.</p>
  
  <p>The headings are:
  Timestamp
  Process
  TID
  Area
  Category
  EventID
  Level
  Message
  Correlation </p>
  
  <p>So given a specific process name I want all distinct Messages.</p>
  
  <p>If I was to use SQL I would write something like this:</p>
  
  <p>select Distinct Message from  where Process like 'myprocessname'</p>
  
  <p>I'd like to do this with powershell across a whole set of log files.</p>
  
  <p>I believe the ULS log is tab or space delimited.</p>