title: Quick File to Hashtable in PowerShell
body: <p>Given an array of key-value pairs (for example read in through ConvertFrom-StringData), is there a streamlined way of turning this into a Hashtable or similar to allow quick lookup? I.e. a way not requiring me to loop through the array and manually build up the hashtable myself.</p>
  
  <p><strong>Example data</strong></p>
  
  <pre><code>10.0.0.1=alice.example.com
  10.0.0.2=bob.example.com
  </code></pre>
  
  <p><strong>Example usage</strong></p>
  
  <pre><code>$names = gc .\data.txt | ConvertFrom-StringData
  // $names is now Object[]
  $map = ?
  // $map should now be Hashtable or equivalent
  echo $map['10.0.0.2'] 
  // Output should be bob.example.com
  </code></pre>
  
  <p>Basically what I'm looking for is a, preferably, built-in file-to-hashtable function. Or an array-to-hashtable function.</p>
  
  <hr>
  
  <p><strong><em>Note:</strong> As <a href="https://stackoverflow.com/a/24459726/39321">@mjolnior</a> explained, I actually got hash tables, but an array of single value ones. So this was fixed by reading the file <code>-raw</code> and hence didn't require any array to hashtable conversion. Updated the question title to match that.</em></p>