Difference between Get-Unique and select-object -unique Difference between Get-Unique and select-object -unique powershell powershell

Difference between Get-Unique and select-object -unique


From Get-Unique help:

The Get-Unique cmdlet compares each item in a sorted list...

Select-Object -Unique does not require objects to be pre-sorted.

Example:

PS> 9,8,9,8 | Get-Unique -AsString9898

Example:

PS> 9,8,9,8 | Sort-Object -Unique89

As for Group-Object, the syntax of the command should be different, replace ($_.Benutzer) with the property name Benutzer:

$csvList | Group-Object Benutzer