title: Selecting first x characters in PowerShell with a catch
body: <p><code>$a</code> is going to be something like "Corners" or "special corners", but could be as long as something like "Standard Window Openings up to 37" which means a simple <code>Substring()</code> won't work (that I'm aware of anyway) if I want to find up to the first 20 characters in <code>$a</code> (that's the catch).</p>
  
  <p>I found this bit is designed to do what I want, but it just gives me</p>
  
  <blockquote>
    <p>"char[] ToCharArray(), char[] ToCharArray(int startIndex, int length)"</p>
  </blockquote>
  
  <p>and I don't know how to make it function correctly.</p>
  
  <pre><code>($a.ToCharArray | select -First 20) -join ""
  </code></pre>