Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell 4.0 Where Operator to Filter

$
0
0

Summary: Use Windows PowerShell 4.0 Where operator to filter results.

Hey, Scripting Guy! Question How can I use a Where operator in Windows PowerShell (without using the pipeline or Where-Object)
           to filter through processes?

Hey, Scripting Guy! Answer Use Get-Process  to group the processes into a collection, then use the Where operator
           and filter on the process name, for example:

(Get-process).Where({$_.ProcessName -eq 'winlogon'})


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>