title: Array index from first to second last in PowerShell
body: <p>How can I get the array element range of first to second last?</p>
  
  <p>For example,</p>
  
  <pre><code>$array = 1,2,3,4,5
  $array[0] - will give me the first (1)
  $array[-2] - will give me the second last (4)
  $array[0..2] - will give me first to third (1,2,3)
  $array[0..-2] - I'm expecting to get first to second last (1,2,3,4) but I get 1,5,4 ???
  </code></pre>
  
  <p>I know I can do long hand and go <code>for($x=0;$x -lt $array.count;$x++)</code>, but I was looking for the square bracket shortcut.</p>