No question, just sharing...having a little fun with arrays. Maybe you'll find it useful. A couple of little functions that show the diversity of PowerShell. Some of this is a lot like Python. It's just too cool what you can do in PowerShell.
$myarray = 'Mr.','John','Smith'
$newarray = Pop-Array $myarray
-or-
$mypercentarray = '90%','75%','40%'
$mynewpercentarray = Pop-Array $mypercentarray -delimiter ~
-or-
$addgreetingtoarray = Push-Array Hello $myarray
function Pop-Array([System.Array]$PopArray,[string]$Delimiter='%'){
return ([string]::join($Delimiter,($PopArray[1..($PopArray.length-1)]))).split($Delimiter)
}
function Push-Array($Element = $null,[System.Array]$PushArray,[string]$Delimiter='%'){
return ("$Element$Delimiter$([string]::join($Delimiter,$PushArray))").split($Delimiter)
}