Produce a sorted list of unique process names

Here's another tip from my colleague Ed Wilson (the Microsoft Scripting Guy) about how to use PowerShell to

Question: You are working on a system, and want to produce a sorted list of unique process names for evaluation. How can you accomplish this task using Windows PowerShell?

Answer: Use the Get-Process cmdlet to produce the list of process objects, pipeline the output to the Sort-Object cmdlet and then to the Select-object cmdlet. Use the –unique switch from the Select-Object cmdlet to filter the list. This technique appears here:

Get-Process | Sort-Object name | Select-Object name -Unique

Mitch Tulloch is a nine-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows administration, deployment and virtualization.For more information see http://www.mtit.com.

Featured Links

Read Next

Mitch Tulloch

Mitch Tulloch is a widely recognized expert on Windows Server and cloud technologies who has written more than a thousand articles and has authored or been series editor for over 50 books for Microsoft Press. He is a twelve-time recipient of the Microsoft Most Valuable Professional (MVP) award in the technical category of Cloud and Datacenter Management.

Latest Podcast

Featured Freeware

Recommended

Follow Us

Produce a sorted list of unique process names

TECHGENIX

TechGenix reaches millions of IT Professionals every month, and has set the standard for providing free technical content through its growing family of websites, empowering them with the answers and tools that are needed to set up, configure, maintain and enhance their networks.