Powershell\'s array notation has rather bizarre, albeit documented, behavior for slicing the end of arrays. This section from the official documentation sums up the bizarreness
Combine Select-Object -Skip and Select-Object -SkipLast like:
Select-Object -Skip
Select-Object -SkipLast
$a = 0,1,2,3 $a | Select-Object -Skip 1 | Select-Object -SkipLast 1
Returns:
1 2
Not as elegant as Python, but at least you don't have to use Count or Length, meaning this also works if the array isn't stored in a variable.
Count
Length