Skip to content

Commit

Permalink
Added pre-sorting required to groupby param.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikefrobbins committed Dec 12, 2024
1 parent 4170a6f commit 4e6728b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ Accept wildcard characters: False
### -GroupBy

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

The value of the **GroupBy** parameter can be a new calculated property. The calculated property can
be a script block or a hash table. Valid key-value pairs are:
Expand Down
6 changes: 2 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Utility/Format-List.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ Accept wildcard characters: False
### -GroupBy

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

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

The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
`Format-List` to group the objects.

The **View** parameter lets you specify an alternate format for the table. You can use the views
defined in the `*.format.PS1XML` files in the PowerShell directory, or you can create your own views
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.
Expand Down
6 changes: 2 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ Accept wildcard characters: False
### -GroupBy

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

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

The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using
`Format-Custom` to group the objects.

The **View** parameter lets you specify an alternate format for the table. You can use the views
defined in the `*.format.PS1XML` files in the PowerShell directory or you can create your own views
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.
Expand Down

0 comments on commit 4e6728b

Please sign in to comment.