PowerShell Daily Dose: Get-Process


Get-Process cmdlet gets all the currently running processes on your machine. If you want to see the instances of a particular application, then you can specify the application name.

This gets you all the processes:

Get-Process

This gets you all the instances of Google Chrome web browser:

Get-Process Chrome

And the output will be like this:

Handles  NPM(K)  PM(K)   WS(K)  VM(M)    CPU(s)  Id       ProcessName
-------  ------  -----   -----  -----    ------  --        -----------
 142        19   27828   34220   206     1.05     2544   chrome
 142        19   28268   33976   217     1.33     2924   chrome

You can also use wildcards in application name. For example, if you want to see all the processes that have “sql” in their names, then you can do this:

PS C:\Learn> get-process *sql*

Handles NPM(K) PM(K)  WS(K)  VM(M) CPU(s) Id ProcessName
------- ------ -----  -----  ----- ------ -- -----------
 288     41     19152   5880 512    1.20 5668 SQLAGENT
 473     30     14572  11448 103    2.31 4232 sqlbrowser
 749    178    513208 322264 143   13.28 3028 sqlservr
  91      9      3408   7596  41    0.16 4260 sqlwriter

You can also specify other parameters like process id, handle etc.

For more information on syntax and usage, please refer to the documentation here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s