title: How to dim an empty array of a specific length
body: <p>I need to copy a collection of 10 items into an array so I can index into it. So I need to use the <code>CopyTo</code> method and specify a destination array large enough to accommodate the collection.</p>
  
  <p>So before calling <code>CopyTo</code> I need to dim an empty array of a specific size. I can't seem to find the correct PowerShell syntax for doing this.</p>
  
  <p>This didn't work for me:</p>
  
  <pre><code>$snapshot = New-Object System.Array 10;
  </code></pre>
  
  <blockquote>
    <p>New-Object : Constructor not found. Cannot find an appropriate constructor for type System.Array.</p>
  </blockquote>
  
  <p><strong>Edit</strong></p>
  
  <p>Have worked around it with:</p>
  
  <pre><code>$snapshot = New-Object System.Collections.ArrayList;
  $snapshot.AddRange($slider);  
  </code></pre>