Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Remove items from an array based on another array

$
0
0
Hi,I have 2 Array or ArrayList objects, with data like[code="vb"]$Results = New-Object system.Collections.ArrayList$Results.Add("IMP_Trn_Project_Agent_6,User1")$Results.Add("IMP_Trn_Project_Agent_6,User2")$Results.Add("IMP_Trn_Project_Agent_6,User3")$Remove = New-Object system.Collections.ArrayList$Remove.Add("User2")[/code]How can I efficiently remove from the first array all items containing the users in the 2nd array?Paul

Viewing all articles
Browse latest Browse all 467

Trending Articles