title: powershell looping and storing content to variable
body: <p>So I need my script to loop through an array and store the content in other variable, so I can manipulate it later.</p>
  
  <pre><code>foreach ($element in $machinesNames){
  Get-BrokerMachine -MachineName $element | select LoadIndex -expand LoadIndex
  }
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>2845
  5750
  5875
  5944
  5873
  5828
  5205
  6302
  5025
  5655
  6311
  5626
  5491
  5621
  </code></pre>
  
  <p>How can I store above results in an array?</p>
  
  <p>Thanks!</p>