Created
February 24, 2017 19:35
-
-
Save NonSecwitter/52a850ef6a51fe73dfe69face59827fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Function Swap-Elements | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true, Position=0)] | |
[ref]$Array, | |
[Parameter(Mandatory=$true, Position=1)] | |
$IndexOne, | |
[Parameter(Mandatory=$true, Position=2)] | |
$IndexTwo | |
) | |
$temp = $Array[$IndexOne] | |
$Array[$IndexOne] = $Array[$IndexTwo] | |
$Array[$IndexTwo] = $temp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment