Show-ConsoleGrid
Shows pipeline objects in an interactive grid and returns the rows you choose.
Syntax
Show-ConsoleGrid [-Culture <CultureInfo>] [-Descending] [-Filter <String>] [-Hide <String[]>] [-InputObject <PSObject>] [-Mode <Rich|Line|Accessible>] [-OutputMode <Single|Multiple>] [[-Property] <Object[]>] [-SortBy <String>] [-Title <String>] [<CommonParameters>]#All Parameter SetsDescription
Shows pipeline objects in an interactive grid and returns the rows you choose.
An Out-GridView for the console, on Windows PowerShell 5.1 and PowerShell 7. Typing filters the rows (every word must appear in a shown column); Up/Down, PgUp/PgDn and Ctrl+Home/Ctrl+End move; F3 sorts by the next column (Shift+F3 the previous one) and F4 reverses the order; Space marks rows (Ctrl+A marks all shown rows); Enter shows the focused row with every column; F2 chooses the columns; Ctrl+Enter (or F10) returns the marked rows, or the focused row when none is marked; Esc clears the filter, then cancels. Columns come from -Property with the same options as Format-ConsoleTable (presenters, priorities, widths, tone rules); the original objects are returned. The screen has the same header bar, panel and footer as menus and forms. In line mode the rows are a numbered list; without an interactive user the cmdlet fails with a clear error.
Examples
EXAMPLE 1
Show-ConsoleGrid -Culture 'Value'Parameters
- -Culture CultureInfo
- The culture for numbers and dates (default CONSOLEMONSTER_CULTURE, then the current culture).
- -Descending SwitchParameter
- Sorts descending at the start.
- -Filter String
- The filter to start with.
- -Hide String[]
- Columns hidden at the start (F2 shows them again).
- -InputObject PSObject
- The objects to show (pipeline input).
- -Mode InteractionMode
- Forces how to ask: Rich (the grid), Line or Accessible (a numbered list), or None (fail without a user).
- Possible values:
Rich,Line,Accessible - -OutputMode GridSelection
- What is returned: Multiple (default; the marked rows or the focused row), Single (the focused row) or None (browse only).
- Possible values:
Single,Multiple - -Property Object[]
- Columns: names, wildcards and calculated properties with the Format-ConsoleTable column options.
- -SortBy String
- The column to sort by at the start.
- -Title String
- The title in the header bar (default Grid).
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.