title: Powershell using a regex to create a new hash table object
body: <p>I'm trying to parse a file that contains blocks of text in this format(there can be 1-n of these):</p>
  
  <pre><code>-----------------------------------------------------------
  KB Article Number(s): 2028769, 2072493, 2120979, 2143880, 2163958, 2163980, 980653, 980883, 981155, 981867, 982321, 982850
  Language: All (Global)
  Platform: x64
  Location: (http://foo.bar.com)
  Password: foo
  -----------------------------------------------------------
  </code></pre>
  
  <p>The text is coming from an MS Hotfix request email if anyone is interested.</p>
  
  <p>I have the following powershell one liner:</p>
  
  <pre><code> $file | select-string "(?&lt;Name&gt;\w+):(?&lt;Value&gt;.*)" -allmatches | SELECT @{N="Name";E={$_.Matches[0].Groups[1].Value}}, @{N="Value";E={$_.Matches[0].Groups[2].Value}}
  </code></pre>
  
  <p>This give me a flat set of name value pairs, I would like it to return an array of hashtables with each of the 5 Keys populated. </p>
  
  <p>I'm not sure if the problem is my regex or how I'm accessing the matches (There must be a less verbose way of picking these out).</p>