Get-Process (Microsoft - PowerShell.Management) - PowerShell - Microsoft Learn
Get-Process (Microsoft - PowerShell.Management) - PowerShell - Microsoft Learn
Get-Process
Reference
Module: Microsoft.PowerShell.Management
Gets the processes that are running on the local computer or a remote computer.
Syntax
PowerShell
Get-Process
[[-Name] <String[]>]
[-ComputerName <String[]>]
[-Module]
[-FileVersionInfo]
[<CommonParameters>]
PowerShell
Get-Process
[[-Name] <String[]>]
[-IncludeUserName]
[<CommonParameters>]
PowerShell
Get-Process
-Id <Int32[]>
[-IncludeUserName]
[<CommonParameters>]
PowerShell
Get-Process
-Id <Int32[]>
[-ComputerName <String[]>]
[-Module]
[-FileVersionInfo]
[<CommonParameters>]
PowerShell
Get-Process
-InputObject <Process[]>
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 1/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
[-IncludeUserName]
[<CommonParameters>]
PowerShell
Get-Process
-InputObject <Process[]>
[-ComputerName <String[]>]
[-Module]
[-FileVersionInfo]
[<CommonParameters>]
Description
The Get-Process cmdlet gets the processes on a local or remote computer.
Without parameters, this cmdlet gets all of the processes on the local computer. You
can also specify a particular process by process name or process ID (PID) or pass a
process object through the pipeline to this cmdlet.
By default, this cmdlet returns a process object that has detailed information about the
process and supports methods that let you start and stop the process. You can also use
the parameters of the Get-Process cmdlet to get file version information for the
program that runs in the process and to get the modules that the process loaded.
Examples
Get-Process
This command gets a list of all active processes running on the local computer. For a
definition of each column, see the Notes section.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 2/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
PowerShell
This command gets all available data about the Winword and Explorer processes on the
computer. It uses the Name parameter to specify the processes, but it omits the
optional parameter name. The pipeline operator ( | ) passes the data to the Format-List
cmdlet, which displays all available properties ( * ) of the Winword and Explorer process
objects.
You can also identify the processes by their process IDs. For instance, Get-Process -Id
664, 2060 .
This command gets all processes that have a working set greater than 20 MB. It uses the
Get-Process cmdlet to get all running processes. The pipeline operator ( | ) passes the
process objects to the Where-Object cmdlet, which selects only the object with a value
greater than 20,000,000 bytes for the WorkingSet property.
WorkingSet is one of many properties of process objects. To see all of the properties,
type Get-Process | Get-Member . By default, the values of all amount properties are in
bytes, even though the default display lists them in kilobytes and megabytes.
$A = Get-Process
$A | Get-Process | Format-Table -View priority
These commands list the processes on the computer in groups based on their priority
class. The first command gets all the processes on the computer and then stores them
in the $A variable.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 3/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
The second command pipes the Process object stored in the $A variable to the Get-
Process cmdlet, then to the Format-Table cmdlet, which formats the processes by using
The Priority view, and other views, are defined in the PS1XML format files in the
PowerShell home directory ( $pshome ).
This example retrieves processes from the local computer. The retrieved processes are
piped to the Format-Table command that adds the StartTime property to the standard
Get-Process output display.
This command uses the FileVersionInfo parameter to get the version information for the
powershell.exe file that is the main module for the PowerShell process.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 4/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
To run this command with processes that you do not own on Windows Vista and later
versions of Windows, you must open PowerShell with the Run as administrator option.
This command uses the Module parameter to get the modules that have been loaded
by the process. This command gets the modules for the processes that have names that
begin with SQL .
To run this command on Windows Vista and later versions of Windows with processes
that you do not own, you must start PowerShell with the Run as administrator option.
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 3
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Domain : DOMAIN01
ReturnValue : 0
User : user01
The first command shows how to find the owner of a process. The IncludeUserName
parameter requires elevated user rights (Run as Administrator). The output reveals that
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 5/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
The second and third command are another way to find the owner of a process.
The second command uses Get-WmiObject to get the PowerShell process. It saves it in
the $p variable.
The third command uses the GetOwner method to get the owner of the process in $p .
The output reveals that the owner is Domain01\user01 .
Get-Process powershell
These commands show how to use the $PID automatic variable to identify the process
that is hosting the current PowerShell session. You can use this method to distinguish
the host process from other PowerShell processes that you might want to stop or close.
The first command gets all of the PowerShell processes in the current session.
The second command gets the PowerShell process that is hosting the current session.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 6/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
This command gets all the processes that have a main window title, and it displays them
in a table with the process ID and the process name.
The mainWindowTitle property is just one of many useful properties of the Process
object that Get-Process returns. To view all of the properties, pipe the results of a Get-
Process command to the Get-Member cmdlet Get-Process | Get-Member .
Parameters
-ComputerName
Specifies the computers for which this cmdlet gets active processes. The default is
the local computer.
Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of
one or more computers. To specify the local computer, type the computer name, a
dot ( . ), or localhost .
This parameter does not rely on Windows PowerShell remoting. You can use the
ComputerName parameter of this cmdlet even if your computer is not configured to
run remote commands.
Type: String[]
Aliases: Cn
Position: Named
Required: False
-FileVersionInfo
Indicates that this cmdlet gets the file version information for the program that runs
in the process.
On Windows Vista and later versions of Windows, you must open PowerShell with
the Run as administrator option to use this parameter on processes that you do not
own.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 7/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
You cannot use the FileVersionInfo and ComputerName parameters of the Get-
Process cmdlet in the same command.
To get file version information for a process on a remote computer, use the Invoke-
Command cmdlet.
Type: SwitchParameter
Position: Named
Required: False
-Id
Specifies one or more processes by process ID (PID). To specify multiple IDs, use
commas to separate the IDs. To find the PID of a process, type Get-Process .
Type: Int32[]
Aliases: PID
Position: Named
Required: True
-IncludeUserName
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 8/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
Indicates that the UserName value of the Process object is returned with results of
the command.
Type: SwitchParameter
Position: Named
Required: True
-InputObject
Specifies one or more process objects. Enter a variable that contains the objects, or
type a command or expression that gets the objects.
Type: Process[]
Position: Named
Required: True
-Module
Indicates that this cmdlet gets the modules that have been loaded by the processes.
On Windows Vista and later versions of Windows, you must open PowerShell with
the Run as administrator option to use this parameter on processes that you do not
own.
To get the modules that have been loaded by a process on a remote computer, use
the Invoke-Command cmdlet.
This parameter is equivalent to getting the Modules property of each process object.
When you use this parameter, this cmdlet returns a ProcessModule object
System.Diagnostics.ProcessModule, not a process object. So, you cannot pipe the
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 9/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
output of the command to a cmdlet that expects a process object, such as Stop-
Process .
When you use both the Module and FileVersionInfo parameters in the same
command, this cmdlet returns a FileVersionInfo object with information about the
file version of all modules.
Type: SwitchParameter
Position: Named
Required: False
-Name
Specifies one or more processes by process name. You can type multiple process
names (separated by commas) and use wildcard characters. The parameter name
( Name ) is optional.
Type: String[]
Aliases: ProcessName
Position: 0
Required: False
Inputs
Process
Outputs
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 10/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
Process
FileVersionInfo
If you use the FileVersionInfo parameter, this cmdlet returns a FileVersionInfo object.
ProcessModule
If you use the Module parameter, without the FileVersionInfo parameter, this cmdlet
returns a ProcessModule object.
Notes
Windows PowerShell includes the following aliases for Get-Process :
gps
ps
On computers that are running a 64-bit version of Windows, the 64-bit version of
PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets
only 32-bit process modules.
To get process information from a remote computer, use the Invoke-Command cmdlet.
For more information, see Invoke-Command.
You can use the properties and methods of the Windows Management Instrumentation
(WMI) Win32_Process object in PowerShell. For information, see Win32_Process.
The default display of a process is a table that includes the following columns. For a
description of all of the properties of process objects, see Process Properties.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 11/12
11/10/23, 12:03 AM Get-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
ProcessName: The name of the process. For explanations of the concepts related
to processes, see the Glossary in Help and Support Center and the Help for Task
Manager.
You can also use the built-in alternate views of the processes available with Format-
Table , such as StartTime and Priority, and you can design your own views.
Related Links
Debug-Process
Get-Process
Start-Process
Stop-Process
Wait-Process
6 Collaborate with us on
PowerShell feedback
GitHub
PowerShell is an open source
The source for this content can project. Select a link to provide
be found on GitHub, where you feedback:
can also create and review
issues and pull requests. For Open a documentation issue
more information, see our
contributor guide. Provide product feedback
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1#outputs 12/12