Skip to content

Update Example 5 in Group-Object.md #1845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
@@ -67,24 +67,26 @@ The command uses the Property parameter to specify that the events should be gro

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.
### Example 5
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
2 BelowNormal {System.Diagnostics.Process (winperf),
```
PS C:\> get-process | group-object -property priorityclass

Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
2 BelowNormal {System.Diagnostics.Process (winperf),
PS C:\> get-process | group-object -property company -noelement
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
Count Name
----- ----
55 Normal
1
3 High
2 BelowNormal
55 Normal
1
3 High
2 BelowNormal
```

This example demonstrates the effect of the NoElement parameter.
28 changes: 15 additions & 13 deletions reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
@@ -74,24 +74,26 @@ The command uses the Property parameter to specify that the events should be gro
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.

### Example 5
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
2 BelowNormal {System.Diagnostics.Process (winperf),
```
PS C:\> get-process | group-object -property priorityclass

Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
2 BelowNormal {System.Diagnostics.Process (winperf),
PS C:\> get-process | group-object -property company -noelement
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
Count Name
----- ----
55 Normal
1
3 High
2 BelowNormal
55 Normal
1
3 High
2 BelowNormal
```

This example demonstrates the effect of the NoElement parameter.
28 changes: 17 additions & 11 deletions reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
@@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g
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.

### Example 5: Group processes by priority class
```
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
2 BelowNormal {System.Diagnostics.Process (winperf),
```

```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
Count Name
----- ----
55 Normal
1
3 High
2 BelowNormal
55 Normal
1
3 High
2 BelowNormal
```

This example demonstrates the effect of the *NoElement* parameter.
28 changes: 17 additions & 11 deletions reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
@@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g
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.

### Example 5: Group processes by priority class
```
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
2 BelowNormal {System.Diagnostics.Process (winperf),
```

```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
Count Name
----- ----
55 Normal
1
3 High
2 BelowNormal
55 Normal
1
3 High
2 BelowNormal
```

This example demonstrates the effect of the *NoElement* parameter.
28 changes: 17 additions & 11 deletions reference/6/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
@@ -74,20 +74,26 @@ The command uses the *Property* parameter to specify that the events should be g
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.

### Example 5: Group processes by priority class
```
```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D...
2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement
Count Name Group
----- ---- -----
55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti...
1 {System.Diagnostics.Process (Idle)}
3 High {System.Diagnostics.Process (Newproc), System.Diagnostic...
2 BelowNormal {System.Diagnostics.Process (winperf),
```

```powershell
PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement
Count Name
----- ----
55 Normal
1
3 High
2 BelowNormal
55 Normal
1
3 High
2 BelowNormal
```

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