June 14th, 2014

PowerTip: Get Unique Numbers by Using PowerShell

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.