Curious if there a construct in PowerShell that does this?
I know you can do this:
$arr = @(1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4)
$arr = $arr | Get-Unique
But seems like performance-wise it would be better to ignore the value as you are entering it into the array instead of filtering out after the fact.
$arr|Sort-Object -Unique -CaseSensitive