8,330 questions
Hi @HinW ,
comparing 2 arrays is possible using the Compare-Object
cmdlet:
$array1 = @("1", "2", "3", "4")
$array2 = @("5", "4", "6", "7", "8")
$array3 = (Compare-Object $array1 $array2 -IncludeEqual | Where-Object { $_.SideIndicator -eq "<=" }).InputObject
$array3
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten