Private/Toggle-Selection.ps1
function Toggle-Selection { param ($Position, [Array]$CurrentSelection) if ($CurrentSelection -contains $Position) { $result = $CurrentSelection | where { $_ -ne $Position } } else { $CurrentSelection += $Position $result = $CurrentSelection } Return $Result } |