Skip to content

Commit f778a37

Browse files
matt9ucciSean Wheeler
authored andcommitted
Update Example 5 in Group-Object.md (#1845)
1 parent 2a3ccf3 commit f778a37

File tree

5 files changed

+81
-59
lines changed

5 files changed

+81
-59
lines changed

reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,26 @@ The command uses the Property parameter to specify that the events should be gro
6767

6868
In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group.
6969
### Example 5
70+
```powershell
71+
PS C:\> Get-Process | Group-Object -Property PriorityClass
72+
73+
Count Name Group
74+
----- ---- -----
75+
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
76+
1 {System.Diagnostics.Process (Idle)}
77+
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
78+
2 BelowNormal {System.Diagnostics.Process (winperf),
7079
```
71-
PS C:\> get-process | group-object -property priorityclass
7280

73-
Count Name Group
74-
----- ---- -----
75-
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
76-
1 {System.Diagnostics.Process (Idle)}
77-
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
78-
2 BelowNormal {System.Diagnostics.Process (winperf),
79-
80-
PS C:\> get-process | group-object -property company -noelement
81+
```powershell
82+
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
8183
8284
Count Name
8385
----- ----
84-
55 Normal
85-
1
86-
3 High
87-
2 BelowNormal
86+
55 Normal
87+
1
88+
3 High
89+
2 BelowNormal
8890
```
8991

9092
This example demonstrates the effect of the NoElement parameter.

reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,26 @@ The command uses the Property parameter to specify that the events should be gro
7474
In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group.
7575

7676
### Example 5
77+
```powershell
78+
PS C:\> Get-Process | Group-Object -Property PriorityClass
79+
80+
Count Name Group
81+
----- ---- -----
82+
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
83+
1 {System.Diagnostics.Process (Idle)}
84+
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
85+
2 BelowNormal {System.Diagnostics.Process (winperf),
7786
```
78-
PS C:\> get-process | group-object -property priorityclass
7987

80-
Count Name Group
81-
----- ---- -----
82-
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
83-
1 {System.Diagnostics.Process (Idle)}
84-
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
85-
2 BelowNormal {System.Diagnostics.Process (winperf),
86-
87-
PS C:\> get-process | group-object -property company -noelement
88+
```powershell
89+
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
8890
8991
Count Name
9092
----- ----
91-
55 Normal
92-
1
93-
3 High
94-
2 BelowNormal
93+
55 Normal
94+
1
95+
3 High
96+
2 BelowNormal
9597
```
9698

9799
This example demonstrates the effect of the NoElement parameter.

reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g
7373
In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group.
7474

7575
### Example 5: Group processes by priority class
76-
```
76+
```powershell
7777
PS C:\> Get-Process | Group-Object -Property PriorityClass
78-
Count Name Group
79-
----- ---- -----
80-
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
81-
1 {System.Diagnostics.Process (Idle)}
82-
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
83-
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
78+
79+
Count Name Group
80+
----- ---- -----
81+
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
82+
1 {System.Diagnostics.Process (Idle)}
83+
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
84+
2 BelowNormal {System.Diagnostics.Process (winperf),
85+
```
86+
87+
```powershell
88+
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
89+
8490
Count Name
8591
----- ----
86-
55 Normal
87-
1
88-
3 High
89-
2 BelowNormal
92+
55 Normal
93+
1
94+
3 High
95+
2 BelowNormal
9096
```
9197

9298
This example demonstrates the effect of the *NoElement* parameter.

reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g
7373
In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group.
7474

7575
### Example 5: Group processes by priority class
76-
```
76+
```powershell
7777
PS C:\> Get-Process | Group-Object -Property PriorityClass
78-
Count Name Group
79-
----- ---- -----
80-
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
81-
1 {System.Diagnostics.Process (Idle)}
82-
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
83-
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
78+
79+
Count Name Group
80+
----- ---- -----
81+
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
82+
1 {System.Diagnostics.Process (Idle)}
83+
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
84+
2 BelowNormal {System.Diagnostics.Process (winperf),
85+
```
86+
87+
```powershell
88+
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
89+
8490
Count Name
8591
----- ----
86-
55 Normal
87-
1
88-
3 High
89-
2 BelowNormal
92+
55 Normal
93+
1
94+
3 High
95+
2 BelowNormal
9096
```
9197

9298
This example demonstrates the effect of the *NoElement* parameter.

reference/6/Microsoft.PowerShell.Utility/Group-Object.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,26 @@ The command uses the *Property* parameter to specify that the events should be g
7474
In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group.
7575

7676
### Example 5: Group processes by priority class
77-
```
77+
```powershell
7878
PS C:\> Get-Process | Group-Object -Property PriorityClass
79-
Count Name Group
80-
----- ---- -----
81-
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
82-
1 {System.Diagnostics.Process (Idle)}
83-
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
84-
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
79+
80+
Count Name Group
81+
----- ---- -----
82+
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
83+
1 {System.Diagnostics.Process (Idle)}
84+
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
85+
2 BelowNormal {System.Diagnostics.Process (winperf),
86+
```
87+
88+
```powershell
89+
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
90+
8591
Count Name
8692
----- ----
87-
55 Normal
88-
1
89-
3 High
90-
2 BelowNormal
93+
55 Normal
94+
1
95+
3 High
96+
2 BelowNormal
9197
```
9298

9399
This example demonstrates the effect of the *NoElement* parameter.

0 commit comments

Comments
 (0)