PowerTip: Get Unique Numbers by Using PowerShell

Doctor Scripto

Dr Scripto

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

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment