powershell select unique 1

powershell select unique

 "One", "Two", "Three", "One", "Two" | Select-Object -Unique

Here is what the above code is Doing:
1. We’re creating a new array with the values “One”, “Two”, “Three”, “One”, “Two”
2. We’re piping that array to the Select-Object cmdlet
3. We’re telling Select-Object to only return unique values

Similar Posts