EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials PowerShell Tutorial PowerShell Get-Process
Secondary Sidebar
PowerShell Tutorial
  • cmdlet
    • PowerShell Wait
    • PowerShell Match
    • cmdlets in PowerShell
    • Start PowerShell from cmd
    • Add-Content in PowerShell
    • Get Help in PowerShell
    • PowerShell Copy-Item
    • PowerShell Remove-Item
    • PowerShell Move-Item
    • Get Command in PowerShell
    • PowerShell Run Command
    • Windows PowerShell ISE
    • Windows Powershell Commands
    • WinRM PowerShell
    • PowerShell Date
    • Powershell Write-Host
    • PowerShell Get-ChildItem
    • PowerShell Sort-Object
    • PowerShell Where Object
    • PowerShell Set-Content
    • PowerShell Set-Location
    • PowerShell Invoke-Command
    • PowerShell Invoke-Webrequest
    • PowerShell Get-Location
    • PowerShell Get-Date
    • PowerShell Get-Service
    • PowerShell Test-Path
    • Powershell Module Path
    • PowerShell Out-File
    • PowerShell if File Exists
    • Powershell Copy File
    • PowerShell Delete File
    • PowerShell New-Item
    • PowerShell Rename-Item
    • PowerShell ComputerName
    • PowerShell Get-Content
    • PowerShell Get-Item
    • PowerShell Get-ADUser
    • PowerShell Grep
    • PowerShell Concatenate String
    • PowerShell Get-Process
    • PowerShell Count
    • PowerShell pause
  • Basics
    • PowerShell Restart Service
    • PowerShell comment
    • PowerShell Map Network Drive
    • PowerShell Append to File
    • PowerShell print
    • What is PowerShell
    • Uses Of Powershell
    • PowerShell Empire
    • PowerShell Parameter
    • PowerShell Stop Service
    • PowerShell Versions
    • How To Install PowerShell
    • PowerShell uninstall module
    • How to Use PowerShell?
    • PowerShell Logging
    • PowerShell Tools
    • PowerShell Commands
    • PowerShell Version Command
    • PowerShell Administrator
    • PowerShell Modules
    • PowerShell Registry
    • PowerShell block Comment
    • PowerShell Verbs
    • PowerShell list
    • PowerShell add user to group
    • PowerShell Write to Console
    • Variable in PowerShell
    • PowerShell New Line
    • PowerShell prompt for input
    • PowerShell File Extension
    • Powershell Remotesigned
    • PowerShell Write to File
    • PowerShell Ping
    • PowerShell wget
    • PowerShell Global variable
    • PowerShell Get-ADGroup
    • Array in PowerShell
    • PowerShell Multidimensional Array
    • PowerShell Array of Strings
    • PowerShell? join array
    • Useful PowerShell Scripts
    • String in PowerShell
    • PowerShell Switch Statement
    • PowerShell Function Parameters
    • PowerShell vs PowerShell ISE
    • PowerShell test-connection
    • PowerShell Test-NetConnection
    • PowerShell GUI
    • PowerShell Variable in String
    • PowerShell Active Directory
  • Variables
    • PowerShell Variables
    • PowerShell Environment Variables
    • PowerShell set environment variable
    • Hashtable in PowerShell
    • Set Variable in PowerShell
  • Operators
    • PowerShell Operators
    • Comparison Operators in PowerShell
    • Logical Operators in PowerShell
    • PowerShell Boolean
    • PowerShell Like Operator
  • Control Statements
    • If Statement in PowerShell
    • If Else in PowerShell
    • Else If in PowerShell
    • Loops in PowerShell
    • For loop in PowerShell
    • PowerShell While Loop
    • PowerShell do while
    • PowerShell Loop through Array
    • PowerShell add to array
    • PowerShell ForEach Loop
    • PowerShell Break
    • PowerShell Continue
    • Switch Case in PowerShell
    • PowerShell If-Not
    • Try-catch in PowerShell
  • Functions
    • PowerShell Functions
    • PowerShell String Functions
    • powershell nslookup
    • PowerShell here string
    • PowerShell Wildcards
    • Regex in PowerShell
    • PowerShell not like
    • PowerShell Filter
    • PowerShell Sleep
    • PowerShell where
    • PowerShell join string
    • PowerShell Exit
    • PowerShell null
    • PowerShell Dictionary
    • PowerShell Location
    • PowerShell Start-Service
    • PowerShell is not digitally signed
    • PowerShell Uptime
    • PowerShell Create Directory
    • PowerShell Trim
    • PowerShell Join-Path
    • PowerShell Execution Policy
    • PowerShell SubString
    • PowerShell Format Table
    • PowerShell Import Module
    • PowerShell ForEach Object
    • PowerShell Alias
    • PowerShell Scheduled Task
    • PowerShell Convert String to Date
    • PowerShell Split String
    • PowerShell Multiline String
    • PowerShell MultiLine Comment
    • PowerShell Rename Folder
    • PowerShell Delete Folder
    • PowerShell String Replace
    • PowerShell join
    • PowerShell xcopy
    • PowerShell Base64
    • PowerShell Tail
    • PowerShell User List
    • PowerShell remove User from group
    • PowerShell JSON Format
    • PowerShell Send Mail
    • PowerShell Convert to String
    • PowerShell Start-Process
    • PowerShell change directory
    • PowerShell Open File
    • PowerShell Batch File
    • PowerShell ZIP
    • PowerShell unzip
    • PowerShell XML
    • PowerShell XML Parsing
    • Remote PowerShell
    • PowerShell Escape Character
    • PowerShell scriptblock
    • PowerShell Executable Location
    • PowerShell Import-CSV?
    • PowerShell Export CSV
  • Interview Questions
    • PowerShell Interview Questions

Related Courses

Shell Scripting Course

All in One Data Science Courses

Data Visualization Courses

PowerShell Get-Process

By Chirag NagarekarChirag Nagarekar

PowerShell Get-Process

Introduction to PowerShell Get-Process

Get-Process cmdlet in PowerShell is used to retrieve the list of processes running in the system and also from the remote system(s). These processes can be applications or system processes. These are the same processes you can see in the task manager, in the Process tab.

Syntax

Get-Process
[[-Name] <String[]>] -Id <Int32[]>
-InputObject <Process[]>
-ComputerName <String>
[-Module] [-FileVersionInfo] [-IncludeUserName] [<CommonParameters>]

The above syntax can be used with different combinations. Not all the times all combinations work. For example, Module and FileversionInfo parameters don’t work together.

Parameters

Some of the parameters are given below:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

  • -Name: When -Name parameter is provided, PowerShell retrieves all the processes with that name. Wildcard character (*) is permitted. You can provide multiple process names separated by comma (,).
  • -ID: The ID parameter defines the process ID. When specific process ID provided, PowerShell retrieves the information about that process ID. The process ID is always an integer. The process ID is a default with the Get-Process output. You can also get the PID from the Resource Manager.
  • -Module: When this parameter is specified with the Get-Process, it shows all the modules that have been loaded by the processes. When PowerShell run as administrator, this parameter shows all the modules for all the users.
  • You can run this command on a remote computer by providing system name in the -ComputerName parameter or by running the Invoke-Command.
  • You can’t pipeline Stop-Process command with this parameter.
  • -ComputerName: You can provide remote system name to retrieve the process running on remote computers. You can provide multiple computer names separated by comma (,).
  • -IncludeUserName: When you add this parameter, Process output shows the column of username by which the particular process is running.
  • -FileVersionInformation: This parameter provides the version of the file or application, responsible for the particular process. To get the list of all the processes file version information from different users, you need to run the PowerShell console as the administrator.
  • You can retrieve the file version details from the remote computer using –ComputerName parameter or the Invoke-Command parameter
  • -InputObject: It specifies the process object. When you create an advanced function, you can also specify the input object as the Pipeline or the variable that contains the process objects.

Examples of Get-Process in Powershell

The examples of PowerShell are shown below:

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,408 ratings)

1. Simple Get-Process command

Get-Process

When you run above command only with no specific parameters, then below table output is the default.

Handle, NPM(K), PM(K), WS(K), Id, SI, ProcessName
Output:

Powershell get-process - Command

2. Get-Process with –Name parameter

Get-Process -Name chrome

Output:

Powershell get-process–Name parameter

To filter multiple processes separate the process name with the comma (,).

Get-Process -Name chrome,WINWORD,AcroRd32

Powershell get-process- Name chrome

3. Get-Process with –ID parameter

Here ID means the Process ID (PID). You can use one of the parameters (ID or PID), both work the same way.

Get-Process -PID 17656

Powershell get-process - ID parameter

You can filter multiple PIDs as well.

Get-Process -Id 17656,4436,1208

filter multiple PIDs

4. Get-Process with –Module parameter

Get-Process -Module

Output:

Powershell get-process–Module parameter

You can find the specific process module by providing the process name.

For example,

Get-Process Calculator -Module

Calculator -Module

5. Get-Process with –FileVersionInformation

To get the File version of the specific process, use the below command.

Get-Process chrome -FileVersionInfo

Output:

File VersionInformation

6. Get-Process with –IncludeUserName command

When you run the PowerShell with the administrator, you can see all the processes running with the different users.

Get-Process -IncludeUserName

To check the processes running with the specific user, you can filter the username.

For example, processes running by the System.

Get-Process -IncludeUserName | where {$_.Username -like "*System*"}

Output:

IncludeUserName command.

7. Get-Process with –ComputerName parameter

You can also use above all the commands for the remote system. To get the processes on the remote system, use –ComputerName parameter.

Get-Process -ComputerName Test-PC

To get the process with specific PID on a remote computer,

Get-Process –PID 12008 -ComputerName Test-PC

8. Restrict Get-Process displayed output

You can also restrict the number of processes to be displayed from the first and the last.

If you want to list out the first 10 processes then you can use the –First parameter with the Select command.

Get-Process | Select -First 10

Output:

running by the System

To get the last 10 processes, use –the Last parameter.

Get-Process | Select -Last 10

Output:

 Select -First 10

9. Sorting Get-Process Output

You can sort the output of the Get-Process using, Sort-Object command.

In the below examples, we will sort processes by its memory utilization (Working set) into Ascending and Descending orders and get the first 5 values.

Get-Process | Sort-Object WorkingSet | Select -First 5

 Sorting Get-Process

The above output will be in ascending order. To sort the processes into descending order use –Descending parameter.

Get-Process | Sort-Object WorkingSet -Descending | Select -First 5

Sort-Object WorkingSet

10. Group the processes

You can group similar processes with their name, so you can identify how many instances are running of the process.

Get-Process | Group-Object ProcessName | Select Count, Name

Group the processes

Conclusion

Get-Process is a great tool for system admins to monitor system performance. Admins can sort the output with CPU and memory utilization and with the command line, admins can find which processes are running by which particular application and the particular user. You can also pipeline Stop-Process command to stop the process(es).

Recommended Articles

This is a guide to PowerShell Get-Process. Here we discuss the introduction, Examples of Get-Process in Powershell and the Parameters along with Syntax & outputs. You can also go through our other suggested articles to learn more –

  1. PowerShell ForEach Object
  2. PowerShell Alias
  3. PowerShell Out-File
  4. PowerShell Test-Path
  5. PowerShell Grep | Examples
  6. PowerShell Wildcards | Types
  7. A Quick Glance of PowerShell If-Not
Popular Course in this category
PowerShell Training (2 Courses, 1 Project)
  2 Online Courses |  1 Hands-on Project |   4+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Shell Scripting Training (4 Courses, 1 Project)4.9
All in One Data Science Bundle (360+ Courses, 50+ projects)4.8
Data Visualization Training (15 Courses, 5+ Projects)4.7
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more