Get List of Running Processes in PowerShell

Migel Hewage Nimesha May 27, 2022
Get List of Running Processes in PowerShell

This article introduces the Get-Process cmdlet to list running processes in PowerShell.

Use Get-Process Cmdlet to Show List of Running Processes in PowerShell

There are more than 200 cmdlets available in the PowerShell environment. Each cmdlet is responsible for performing a specific function.

The Get-Process is one of the frequently used cmdlets that help retrieve the list of running processes on the Windows machine.

This cmdlet gives useful information related to each process, such as process ID, name, memory usage, etc. Also, it shows a snapshot of the system’s running processes.

Syntax:

Get-Process [[-ProcessName] string[]] [-NameOfTheComputer string[]]
         [-FileVersionInfo] [-Module] [CommonParameters]

Get-Process -processID Int32[] [-ComputerName string[]]
         [-FileVersionInfo] [-Module] [CommonParameters]

Get-Process -ProcessInputObject Process[] [-ComputerName string[]]
         [-FileVersionInfo] [-Module] [CommonParameters]

The parameters are optional to the Get-Process cmdlet, and you can use those parameters based on your requirement.

Display All the Running Processes

We can directly use the Get-Process command without any parameters. It should display all the running processes at that time.

Also, the gps alias can be used instead of the Get-Process command.

Get-Process
gps

Output:

Display All the Running Processes

There is several useful information available in the output table.

  1. Id - The unique identifier for a given process.
  2. ProcessName - The name of the process.
  3. CPU(s) - This is the processor time that the process has used (given in seconds).
  4. PM(K) - The size of the pageable memory (given in Kilo-bytes).

Retrieve the Information for a Single Process

Get-Process -Name typora

OR

Get-Process typora

The above two commands will filter the list of processes by the given process name and display the running processes for that particular process name.

Output:

Get-Process -Name

Retrieve the Information for Multiple Processes

You can specify more than one process by its name as the name parameter. It will list down all the processes with the relevant information.

Get-Process NotePad, Outlook

Output:

Get-Process Multiple

Also, you can use the wild cards for the process name.

Retrieve Process Objects With the Given Attributes

We can display the process object information for specific attributes when needed. Let’s retrieve only the Process ID for the NotePad process.

(Get-Process NotePad).Id

Output:

Retrieve Process Objects With the Given Attributes

Also, we can retrieve the CPU time attribute for the NotePad process, as shown in the following.

(Get-Process NotePad).CPU

Output:

getprocess cpu

Display the Process Owner

The default output of the Get-Process command doesn’t display the ProcessOwner attribute. But this can be a piece of valuable information when you need to terminate a given process.

We can use the -IncludeUserName parameter to include the ProcessOwner attribute in the output.

Get-Process -Name notepad -IncludeUserName

Output:

Get-Process IncludeUserName

Migel Hewage Nimesha avatar Migel Hewage Nimesha avatar

Nimesha is a Full-stack Software Engineer for more than five years, he loves technology, as technology has the power to solve our many problems within just a minute. He have been contributing to various projects over the last 5+ years and working with almost all the so-called 03 tiers(DB, M-Tier, and Client). Recently, he has started working with DevOps technologies such as Azure administration, Kubernetes, Terraform automation, and Bash scripting as well.