-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGet-Process
More file actions
30 lines (21 loc) · 703 Bytes
/
Get-Process
File metadata and controls
30 lines (21 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Selecting
#Default
Get-Process
# All Properties
Get-Process | Select-Object -Property * | Out-GridView
# Sorting
# Changes the default sorting order for Get-Process
Get-Process | Sort-Object CPU
# Minimize the data and sort
Get-Process | Select-Object ProcessName, CPU | Sort-Object CPU -Descending
## Caution
# Mission: Get the top 10 processes by CPU usage (which 10 processes have the most CPU usage)
Get-Process |
Select-Object ProcessName, CPU -First 10 |
Sort-Object CPU -Descending
# or
Get-Process |
Sort-Object CPU -Descending |
Select-Object ProcessName, CPU -First 10
# or
Get-Process | Select-Object ProcessName, CPU | Sort-Object CPU -Descending