PowerTip: Get Unique Numbers by Using PowerShell

PowerTip: Get Unique Numbers by Using PowerShell

  • Comments 3
  • Likes

Summary: Easily get unique numbers from a list by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to get unique numbers from a list of numbers?

Hey, Scripting Guy! Answer Use the Get-Unique cmdlet, for example:

PS C:\> 1,2,2,3,4,4,5 | Get-Unique

1

2

3

4

5

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Alternate methods
    1,2,2,3,4,4,5 | Select -Unique

    1,2,2,3,4,4,5 | Sort -Unique

  • thank you