Skip to content

Commit 236615e

Browse files
authored
Added pre-sorting required to groupby param. (#11583)
Co-authored-by: Mike F. Robbins <[email protected]>
1 parent 4170a6f commit 236615e

File tree

9 files changed

+18
-27
lines changed

9 files changed

+18
-27
lines changed

reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ Accept wildcard characters: False
161161
### -GroupBy
162162

163163
Formats the output in groups based on a shared property or value. Enter an expression or a property
164-
of the output.
164+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
165+
cmdlet before using `Format-Custom` to group the objects.
165166

166167
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
167168
be a script block or a hash table. Valid key-value pairs are:

reference/5.1/Microsoft.PowerShell.Utility/Format-List.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ Accept wildcard characters: False
175175
### -GroupBy
176176

177177
Specifies the output in groups based on a shared property or value. Enter an expression or a
178-
property of the output.
178+
property of the output. The **GroupBy** parameter expects that the objects are sorted. Use the
179+
`Sort-Object` cmdlet before using `Format-List` to group the objects.
179180

180181
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
181182
be a script block or a hash table. Valid key-value pairs are:
@@ -314,9 +315,6 @@ verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`.
314315
If you do not use a format cmdlet, PowerShell applies that default format for each object that it
315316
displays.
316317

317-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
318-
`Format-List` to group the objects.
319-
320318
The **View** parameter lets you specify an alternate format for the table. You can use the views
321319
defined in the `*.format.PS1XML` files in the PowerShell directory, or you can create your own views
322320
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ Accept wildcard characters: False
177177
### -GroupBy
178178

179179
Formats the output in groups based on a shared property or value. Enter an expression or a property
180-
of the output.
180+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
181+
cmdlet before using `Format-Wide` to group the objects.
181182

182183
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
183184
be a script block or a hash table. Valid key-value pairs are:
@@ -307,9 +308,6 @@ Windows PowerShell includes the following aliases for `Format-Wide`:
307308

308309
- `fw`
309310

310-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
311-
`Format-Custom` to group the objects.
312-
313311
The **View** parameter lets you specify an alternate format for the table. You can use the views
314312
defined in the `*.format.PS1XML` files in the PowerShell directory or you can create your own views
315313
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ Accept wildcard characters: False
161161
### -GroupBy
162162

163163
Formats the output in groups based on a shared property or value. Enter an expression or a property
164-
of the output.
164+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
165+
cmdlet before using `Format-Custom` to group the objects.
165166

166167
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
167168
be a script block or a hash table. Valid key-value pairs are:

reference/7.4/Microsoft.PowerShell.Utility/Format-List.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ Accept wildcard characters: False
175175
### -GroupBy
176176

177177
Specifies the output in groups based on a shared property or value. Enter an expression or a
178-
property of the output.
178+
property of the output. The **GroupBy** parameter expects that the objects are sorted. Use the
179+
`Sort-Object` cmdlet before using `Format-List` to group the objects.
179180

180181
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
181182
be a script block or a hash table. Valid key-value pairs are:
@@ -315,9 +316,6 @@ verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`.
315316
If you do not use a format cmdlet, PowerShell applies that default format for each object that it
316317
displays.
317318

318-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
319-
`Format-List` to group the objects.
320-
321319
The **View** parameter lets you specify an alternate format for the table. You can use the views
322320
defined in the `*.format.PS1XML` files in the PowerShell directory, or you can create your own views
323321
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ Accept wildcard characters: False
177177
### -GroupBy
178178

179179
Formats the output in groups based on a shared property or value. Enter an expression or a property
180-
of the output.
180+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
181+
cmdlet before using `Format-Wide` to group the objects.
181182

182183
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
183184
be a script block or a hash table. Valid key-value pairs are:
@@ -308,9 +309,6 @@ PowerShell includes the following aliases for `Format-Wide`:
308309
- All platforms:
309310
- `fw`
310311

311-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
312-
`Format-Custom` to group the objects.
313-
314312
The **View** parameter lets you specify an alternate format for the table. You can use the views
315313
defined in the `*.format.PS1XML` files in the PowerShell directory or you can create your own views
316314
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

reference/7.5/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ Accept wildcard characters: False
161161
### -GroupBy
162162

163163
Formats the output in groups based on a shared property or value. Enter an expression or a property
164-
of the output.
164+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
165+
cmdlet before using `Format-Custom` to group the objects.
165166

166167
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
167168
be a script block or a hash table. Valid key-value pairs are:

reference/7.5/Microsoft.PowerShell.Utility/Format-List.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ Accept wildcard characters: False
175175
### -GroupBy
176176

177177
Specifies the output in groups based on a shared property or value. Enter an expression or a
178-
property of the output.
178+
property of the output. The **GroupBy** parameter expects that the objects are sorted. Use the
179+
`Sort-Object` cmdlet before using `Format-List` to group the objects.
179180

180181
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
181182
be a script block or a hash table. Valid key-value pairs are:
@@ -315,9 +316,6 @@ verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`.
315316
If you do not use a format cmdlet, PowerShell applies that default format for each object that it
316317
displays.
317318

318-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
319-
`Format-List` to group the objects.
320-
321319
The **View** parameter lets you specify an alternate format for the table. You can use the views
322320
defined in the `*.format.PS1XML` files in the PowerShell directory, or you can create your own views
323321
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

reference/7.5/Microsoft.PowerShell.Utility/Format-Wide.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ Accept wildcard characters: False
177177
### -GroupBy
178178

179179
Formats the output in groups based on a shared property or value. Enter an expression or a property
180-
of the output.
180+
of the output. The **GroupBy** parameter expects that the objects are sorted. Use the `Sort-Object`
181+
cmdlet before using `Format-Wide` to group the objects.
181182

182183
The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
183184
be a script block or a hash table. Valid key-value pairs are:
@@ -308,9 +309,6 @@ PowerShell includes the following aliases for `Format-Wide`:
308309
- All platforms:
309310
- `fw`
310311

311-
The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
312-
`Format-Custom` to group the objects.
313-
314312
The **View** parameter lets you specify an alternate format for the table. You can use the views
315313
defined in the `*.format.PS1XML` files in the PowerShell directory or you can create your own views
316314
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

0 commit comments

Comments
 (0)