filter duplicates from arrays
taijidude

taijidude @taijidude

About: Java Developer. Love to read and learn. Hobbies: - tabletop rpgs - boardgames - videogames - cooking - kettlebell

Location:
Hannover, Germany
Joined:
Jul 22, 2020

filter duplicates from arrays

Publish Date: Mar 19 '21
6 0

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

Comments 0 total

    Add comment