|
|
powershell > Cmdlet Help > Microsoft.PowerShell.Management > Get-Process
Get-ProcessFrom $1Table of contents
SyntaxGet-Process -Id [<Int32[]>] [-ComputerName [<string>]] [<CommonParameters>] Get-Process -InputObject [<Process[]>] [-ComputerName [<string>]] [<CommonParameters>] Get-Process [[-Name] [<string[]>]] [-ComputerName [<string>]] [<CommonParameters>] Detailed DescriptionThe Get-Process cmdlet gets the processes on a local or remote computer. Without parameters, "Get-Process" gets all of the processes on the computer, as though you typed "Get-Process *". You can also identify a particular process by process name or process ID (PID) or pass a process object through the pipeline to Get-Process. For Get-Process, the default input is the process name. For Stop-Process, the default input is the process ID.Parameters-ComputerName [<string>]Gets the processes running on the specified computer. The default is the local computer. Type the NETBIOS name, an IP address, or a fully-qualified domain name of a remote computer. When the computer is in a different domain than the user, the fully-qualified domain name is required. This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of Get-Process even if your computer is not configured to run remote commands.
-Id [<Int32[]>]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".
-InputObject [<Process[]>]Specifies a process object. Enter a variable that contains the objects or type a command or expression that gets the objects.
-Name [<string[]>]Specifies one or more processes by process name. You can type multiple process names (separated by commas) or use wildcard characters. The parameter name ("-Name") is optional.
NotesFor more information, type "Get-Help Get-Process -detailed". For technical information, type "Get-Help Get-Process -full". When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>". You cannot use the -Name, -ID, and -InputObject parameters in the same command. You can also refer to Get-Process by its built-in aliases, "ps" and "gps". For more information, see About_Alias. You can also use the properties and methods of the WMI Win32_Process object in Windows PowerShell. For information, see Get-WmiObject and the Windows Management Instrument SDK. The default display of a process is a table that includes the following columns: -- Handles: The number of handles that the process has opened. -- NPM(K): The amount of non-paged memory that the process is using, in kilobytes. -- PM(K): The amount of pageable memory that the process is using, in kilobytes. -- WS(K): The size of the working set of the process, in kilobytes. The working set consists of the pages of memory that were recently referenced by the process. -- VM(M): The amount of virtual memory that the process is using, in megabytes. Virtual memory includes storage in the paging files on disk. -- CPU(s): The amount of processor time that the process has used on all processors, in seconds. -- ID: The process ID (PID) of the process. -- ProcessName: The name of the process. For explanations of the concepts related to processes, use the Glossary in Help and Support Center and 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. For more information, type "Get-Help Format-Table -detailed". ExamplesEXAMPLE 1PS> Get-Process
This command gets a list of all of the running processes running on the local computer. For a definition of each column, see Additional Notes in "Get-Help Get-Process -Full." EXAMPLE 2PS> Get-Process winword, explorer | format-list *
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 example, "get-process -id 664, 2060". EXAMPLE 3PS> get-process | where-object {$_.WorkingSet -gt 20000000}
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. EXAMPLE 4PS> $a = get-process
These commands list the processes on the computer grouped by priority. The first command gets all of the processes on the computer and stores them in the $a variable. The second command uses the InputObject parameter to pass the process objects stored in $a to Get-Process. The pipeline operator passes the objects to the Format-Table cmdlet, which formats the processes by using the "Priority" view defined in the PS1XML format files in the Windows PowerShell home directory ($pshome).
Tags:
|
||||||||||||||||||||||||||||||||||||||||