title: How do I create array of arrays in PowerShell?
body: <p>I want to create an array of arrays in PowerShell.</p>
  
  <pre><code>$x = @(
      @(1,2,3),
      @(4,5,6)
  )
  </code></pre>
  
  <p>It works fine. However, sometimes I have only one array in the array list. In that situation, PowerShell ignores one of the lists:</p>
  
  <pre><code>$x = @(
      @(1,2,3)
  )
  
  $x[0][0] # Should return 1
  Unable to index into an object of type System.Int32.
  At line:1 char:7
  + $a[0][ &lt;&lt;&lt;&lt; 0]
      + CategoryInfo          : InvalidOperation: (0:Int32) [], RuntimeException
      + FullyQualifiedErrorId : CannotIndex
  </code></pre>
  
  <p>How do I create an array of arrays, guaranteed it remains as a two-dimensional array even if the array has only one array item in it?</p>