title: Calculate time from document
body: <p>Building on <A HREF="http://stackoverflow.com/questions/41191768/pull-data-from-a-document/41191932#41191932">my previous question</A> (thanks @MartinBrandl), I'd like to grab the time values to calculate time as well.</p>
  
  <p>Example data:</p>
  
  <pre><code>07:30 - 07:45PMTS09526052 | Sev9 | Location| | Due: 12/23/2016
  NON PC HARDWARE - TROUBLESHOOT SW
  Complete this Job
  </code></pre>
  
  <p>Martin Brandl came up with this to get the other data I need:</p>
  
  <pre><code>Select-String $WLDir -pattern '(PMT[S|T]\d{8})' -Context 0,2 | ForEach-Object {
  [PSCustomObject]@{
      Time = $_.Matches.Groups[1].Value
      Topic = $_.Context.PostContext[0]
      Status = $_.Context.PostContext[1]
  }
  } | ConvertTo-Csv -NoTypeInformation
  </code></pre>
  
  <p>I'd like to grab the <code>07:30 - 07:45</code> bit from right before the <code>PMT</code> part.  I plan to use this to get the time:</p>
  
  <pre><code>$StartTime = [However I get the `7:30` here]
  $EndTime = [However I get the `7:45` here]
  $ElapsedTime = (NEW-TIMESPAN –Start $StartTime –End $EndTime).TotalHours
  </code></pre>
  
  <p>and I'd add a fourth field to the CSV:</p>
  
  <pre><code>Elapsed = $ElapsedTime
  </code></pre>
  
  <p>But I'm not sure how specifically to grab the two times and isolate them as variables.  Can anyone assist?</p>