Created
November 8, 2015 20:43
-
-
Save lazywinadmin/5fee7350e3b2a73096ea to your computer and use it in GitHub Desktop.
Add reverse method to array object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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