HOWTO · PowerShell

How to Get List of Running Processes in PowerShell

Use PowerShell Get-Process to list local processes, filter by name, inspect process properties, and request the associated account on Windows.

On this page

Use Get-Process to list processes running on the local computer, narrow the results by process name, and inspect values such as Id and CPU. The examples below are PowerShell commands and have not been executed in the supplied runtime evidence. Process names and displayed values depend on what is running on your computer and the PowerShell environment.

List All Running Processes with Get-Process

Run Get-Process with no arguments to get process objects for local processes. PowerShell formats those objects for display, commonly as a table. The default view can include fields such as Id (the process identifier), ProcessName, CPU (accumulated processor time in seconds), and memory-related values. The displayed columns are a view, not a complete or fixed list of every process property; the columns and values can vary by environment. gps is an optional alias for Get-Process.

This example selects a small set of useful fields from the first ten returned process objects:

Get-Process | Select-Object -First 10 Id, ProcessName, CPU, WorkingSet64

Find Processes by Name

Pass a process name to -Name to filter the results. Replace the selected name with one that is running on your computer. You can pass an array of names to retrieve matches for several processes, or use wildcard characters such as * to match a name pattern. The example derives names from processes on the current computer so it does not depend on a particular application being installed:

$names = @(Get-Process | Select-Object -First 2 -ExpandProperty ProcessName | Sort-Object -Unique)
if ($names.Count -gt 0) {
    Get-Process -Name $names
    $prefix = $names[0].Substring(0, [Math]::Min(2, $names[0].Length))
    Get-Process -Name "$prefix*"
}

Get-Process -Name can return more than one process when multiple instances match a name. Wildcards are useful when you know only part of a process name. If your own query returns no matches, check the spelling and whether that process is currently running.

Read Process Properties

Get-Process returns objects, so you can read a property directly instead of relying on the formatted table. Id is the process identifier. CPU reports accumulated processor time in seconds when that value is available; it is not a live percentage measurement. A name can match multiple process objects, so property access can produce multiple values. This example reads both properties from a process found on the local computer:

$process = Get-Process | Select-Object -First 1
if ($process) {
    $process.Id
    $process.CPU
}

Use Select-Object Id, CPU after a name filter when you want those fields displayed together for each matching process. The process list is a snapshot, so a process may start or stop between separate commands.

Display the Process Owner

On Windows, add -IncludeUserName to request the account associated with each returned process. The account value is exposed as UserName; it is not a ProcessOwner property. Access to account information can depend on permissions and the process. This option is platform-specific, so use it in a Windows PowerShell environment that supports it. Identifying an account is useful for troubleshooting, but it is not required simply to terminate a process.

The example chooses a process currently present on the computer and captures a lookup error as text if the account cannot be retrieved:

$process = Get-Process | Select-Object -First 1
if ($process) {
    try {
        Get-Process -Id $process.Id -IncludeUserName | Select-Object Id, ProcessName, UserName
    }
    catch {
        "Could not retrieve UserName: $($_.Exception.Message)"
    }
}