There’s a third way to find pairs for given sum that’s a bit more complicated.
function get-pairs2 {
[CmdletBinding()]
param (
[int[]]$iarray,
[int]$value
)
$sarray = $iarray | Sort-Object
Write-Information -MessageData "Array: $iarray" -InformationAction… Read the full text.