Is there a function that reverses elements passed via pipeline?
E.g.:
PS C:\> 10, 20, 30 | Reverse
30
20
10
You can cast $input within the function directly to a array, and then reverse that:
function reverse
{
$arr = @($input)
[array]::reverse($arr)
$arr
}