PowerTip: Count backwards in array
Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to count backwards in a Windows PowerShell array.
I know I can access the first, second, and third items in an array by using $Array, $Array, and $Array, but how can I count backwards?
Use negative numbers, for example:
$Array = @(‘first’,’second’,’third’)
This will output the following: