Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Get-unique items from an array

$
0
0

Get-Unique compares each item in a list with the next item in the list and will only work against sorted lists.

If you want to user Get-Unique you have to sort the list first:

$a | Sort-Object -Property Id | Get-Unique

Or you could use Select-Object to select unique entries from the list:

$a | Select-Object -Unique

Viewing all articles
Browse latest Browse all 13067

Trending Articles