title: PsObject array in powershell
body: <p>This is my code : </p>
  
  <pre><code>$a = @()
  
  for ($i = 0; $i -lt 5; $i++)
  {
  
  $item = New-Object PSObject
  $item | Add-Member -type NoteProperty -Name 'Col1' -Value 'data1'
  $item | Add-Member -type NoteProperty -Name 'Col2' -Value 'data2'
  $item | Add-Member -type NoteProperty -Name 'Col3' -Value 'data3'
  $item | Add-Member -type NoteProperty -Name 'Col4' -Value 'data4'
  
  $a += $item
  }
  </code></pre>
  
  <p>With this code I'm able to have a result like this:</p>
  
  <pre><code>Col1 Col2 Col3 Col4
  ---- ---- ---- ----
     0    1    2    3
     1    2    3    4
     2    3    4    5
     3    4    5    6
     4    5    6    7
  </code></pre>
  
  <p>Well, it's good, but how to achieve it more simply and more proper? Is there a way to create Array <code>PsObject</code> maybe?</p>
  
  <p>I'm using <code>Powershell v4</code>.</p>