title: How to add same keys with different values to a hashtable in powershell?
body: <p>Here is the code where i used array of hashtables</p>
  <pre><code>$podnumbers = @(1,3,1)
  
  $podInfo = $null
  $buffer = 0
  $podarray = foreach ($pd in $podnumbers) {
      $podinfo = @()
      for($i=0;$i -lt $pd;$i = $i+1) {
      $pod = Read-Host -Prompt &quot;Assign the pod numbers for&quot;,$esxarray[$buffer]
      Write-Output `n
      }
      @{$pd = $pod}
  $buffer = $buffer + 1
  }
  </code></pre>
  <p>Inputs I gave for $pod is 1 = 1 ; 3 = 2,4,6 ; 1 = 3</p>
  <p>I want my arrays of hashtable to be like below,</p>
  <pre><code>Key : 1
  Value : 1
  Name : 1
  
  Key : 3
  Value : 2,4,6
  Name : 3
  
  Key : 1
  Value : 3
  Name : 1
  </code></pre>
  <p>But the actual output I got is,</p>
  <pre><code>Key : 1
  Value : 1
  Name : 1
  
  Key : 3
  Value : 2
  Name : 3
  
  Key : 3
  Value : 4
  Name : 3
  
  Key : 3
  Value : 6
  Name : 3
  
  Key : 1
  Value : 3
  Name : 1
  </code></pre>