PowerShell Genie

Get-Process

Use Get-Process to get the processes that are running on the local computer.

Command 1 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — Get-Process

Syntax

1PS> Get-Process [[-Name] <string[]>] [-Module] [-FileVersionInfo] [<CommonParameters>]
See the command anatomy

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

Get-Process [[-Name] <string[]>] [-Module] [-FileVersionInfo] [<CommonParameters>]
  1. Stage 1Get-Process-Name -Module -FileVersionInfo

    Try it

    Windows PowerShell

    Browser simulation · fictional data; no changes to your computer.

    Interactive simulation · fictional data

    Examples

    List all with Get-Process

    1PS> Get-Process
    Show reference output

    Illustrative output · values vary by environment

    Handles NPM(K) PM(K) WS(K)  CPU(s) Id    SI ProcessName
    ------- ------ ----- ------ ------ ----- -- -----------
        912     65 31254 475124 842.31  9184  1 chrome
        234     12 15240  12288   0.40  3200  1 notepad
        356     28 89200  76800  18.27 11268  1 pwsh
        189     15 24120  32768   1.40  4400  0 spoolsv
        642     45 56320 215040 950.00  2600  0 MsMpEng

    Get-Process -ErrorAction SilentlyContinue

    1PS> Get-Process -ErrorAction SilentlyContinue
    Show reference output

    Illustrative output · values vary by environment

    Handles NPM(K) PM(K) WS(K)  CPU(s) Id    SI ProcessName
    ------- ------ ----- ------ ------ ----- -- -----------
        912     65 31254 475124 842.31  9184  1 chrome
        234     12 15240  12288   0.40  3200  1 notepad
        356     28 89200  76800  18.27 11268  1 pwsh
        189     15 24120  32768   1.40  4400  0 spoolsv
        642     45 56320 215040 950.00  2600  0 MsMpEng

    Parameters

    Parameter definitions:

    • -Name
    • -Module
    • -FileVersionInfo

    Get-Process on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Get-Process when you need to get the processes that are running on the local computer. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.

    Common error and fix: A process-not-found error may simply mean the program exited. Query by a current process ID when possible and handle that race explicitly rather than assuming the name is permanently present. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.

    See also: Get-Service. Get-Process describes running processes; Get-Service describes installed service objects. A service name does not necessarily equal the name of its hosting executable. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Get-Process reference on Microsoft Learn

    Put this command to work

    Find the busiest process

    Return the complete process record with the highest CPU value.

    Review the lesson

    Recap

    Get-Process Use Get-Process to get the processes that are running on the local computer.

    Next: Stop-Process
    Genie guideGet-Process

    Use Get-Process to get the processes that are running on the local computer. The console below is pre-loaded — run it, then change a value and run it again.