Select Object/s and sort by parameters

Greetings.

Not only is this my first question in this forum but this is also my first post. I hope being part of this forum would help me a lot in improving my skills in PowerShell.

My first question:

How do I exclusively display values based on numeral value? I’m practicing the comand " get-process " so I get something like

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName


 54       7     1356       5748    58     0.03   1100 conhost
 56       7     2184       8236    60     8.99   1264 conhost
 34       4      964       2916    43     0.00   1996 conhost
310      10     1836       3780    42             340 csrss
313      23     6084      10428    78             380 csrss
169      20   135096      44904   225    59.81   2160 dwm
815      56    48432      79816   310    23.01   2184 explorer
818      93   314196     339504   664   277.37   2608 firefox

I know how to display whatever column like " get-process | select-object handles/ProcessName/Id.

How do you enter the required parameters to display what you want like, handles less than 500, or ProcessNames that end with the letter “t”?

Also, is there a command to display an array(in its true form)? A command that would show you that get-process is written as $process = @{handles = “…”; id = “…”}

I apologise if asking a lot of simple questions from here is annoying but I’m very keen to learn improve in PS and I’m really new to it. Thanks.

Hi Bryan,

Welcome to the amazing world of Windows PowerShell.

Depending on how you like to learn (reading or watching):

Handle count lower than (-lt):

Get-Process | Where-Object { $_.Handles -lt 500 } | Select-Object -Property Handles, ProcessName, Id

Process name ends with t:

Get-Process | Where-Object { $_.ProcessName -like '*t' } | Select-Object -Property Handles, ProcessName, Id

Get online help for Where-Object and navigate to the examples at the end of the page:

Get-Help Where-Object -Online

Best,
Daniel