filter duplicates from arrays

taijidude - Mar 19 '21 - - Dev Community

Hello again, it's been a while. Have several things on my plate, so it's only a short post again.

If you want to get rid of duplicates in a powershell array you have to pipe the array into a select keyword with a -Unique parameter.

@("1","2", "3", "4", "2", "2", "2", "2", "5") | select -Unique
Enter fullscreen mode Exit fullscreen mode

It will give you the following result:

Alt Text

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player