title: How can I initialize an array of arrays (multidimensional) in PowerShell 5.0
body: <p>I'm trying to partition out chunks of work using PowerShell (5.0) and am having a hard time instantiating a multidimensional array.  </p>
  
  <pre><code>$n = 456;
  $MaxChunks = 6;
  
  $Chunks = @();
  
  for($x = 0; $x -lt $MaxChunks; $x++)
  {    
      Write-Host "Creating chunk $x"    
      $Chunks += @();
  }
  </code></pre>
  
  <p><code>$Chunks.Count</code> always returns 0 and I cannot access anything in $Chunks by index (i.e. <code>$Chunks[0]</code> is null). </p>
  
  <p>Ultimately, my goal is to access the array located at <code>$Chunks[$i]</code> and add multiple <code>System.Data.DataRow</code> objects to it. However, as I've said, I'm not able to access the array at that index because that array is never instantiated.</p>
  
  <p>I've read through <a href="https://stackoverflow.com/questions/40431840/powershell-add-to-multidimensional-array">this</a> and <a href="https://stackoverflow.com/questions/9397137/powershell-multidimensional-arrays">this</a> but am not quite able to translate the hashtable scenario to my situation.  </p>