Skip to content

Instantly share code, notes, and snippets.

@lazywinadmin
Created November 8, 2015 20:43
Show Gist options
  • Save lazywinadmin/5fee7350e3b2a73096ea to your computer and use it in GitHub Desktop.
Save lazywinadmin/5fee7350e3b2a73096ea to your computer and use it in GitHub Desktop.
Add reverse method to array object
add-type -ass system.linq
update-typedata -TypeName System.Array -MemberType ScriptMethod -MemberName Reverse -Value { [System.Linq.Enumerable]::reverse($this) }
[int[]]$a =@(1,2,3,4,5)
$a.reverse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment