Skip to content
This repository was archived by the owner on Jun 24, 2026. It is now read-only.

Commit e4be9df

Browse files
tigCopilot
andcommitted
Remove OCGV, rename OCTV to OCGV
- Delete old OCGV implementation files (GridViewDataSource, GridViewHelpers, GridViewRow, Header, OutConsoleGridviewCmdletCommand, OutConsoleGridView old) - Rename OutConsoleTableViewCmdletCommand -> OutConsoleGridViewCmdletCommand - Rename OutTableViewDataSource -> OutGridViewDataSource - Rename OutTableViewWindow -> OutGridViewWindow - Rename OutConsoleTableView -> OutConsoleGridView - Update cmdlet attribute to [Cmdlet("ConsoleGridView")] with alias "ocgv" - Rename -ForceDriver to -Driver with [Alias("ForceDriver")] for compat - Add Ctrl+D deselect-all keybinding - Update README, docs, launchSettings, and tests - Delete Out-ConsoleTableView.md doc, update Out-ConsoleGridView.md with full feature set (streaming, sorting, Search, Focus parameters) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 24334e1 commit e4be9df

19 files changed

Lines changed: 513 additions & 2538 deletions

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ConsoleGuiTools - `Out-ConsoleGridView`, `Out-ConsoleTableView`, and `Show-ObjectTree`
1+
# ConsoleGuiTools - `Out-ConsoleGridView` and `Show-ObjectTree`
22

3-
This repo contains the `Out-ConsoleGridView`, `Out-ConsoleTableView`, and `Show-ObjectTree`
3+
This repo contains the `Out-ConsoleGridView` and `Show-ObjectTree`
44
PowerShell Cmdlets providing console-based GUI experiences based on
55
[Terminal.Gui (gui.cs)](https://github.com/gui-cs/Terminal.Gui).
66

@@ -14,8 +14,7 @@ Install-Module Microsoft.PowerShell.ConsoleGuiTools
1414

1515
## Features
1616

17-
* [`Out-ConsoleGridview`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) - Send objects to a grid view window for interactive filtering and sorting.
18-
* [`Out-ConsoleTableView`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleTableView.md) - Send objects to a table view with column headers, horizontal scrolling, streaming, and native multi-selection.
17+
* [`Out-ConsoleGridView`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) - Send objects to an interactive table view with column headers, horizontal scrolling, streaming, sorting, and native multi-selection.
1918
* [`Show-ObjectTree`](docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md) - Send objects to a tree view window for interactive filtering and sorting.
2019

2120
* Cross-platform - Works on any platform that supports PowerShell 7.2+.
@@ -130,21 +129,21 @@ This command gets the processes running on the local computer and sends them to
130129

131130
Use right arrow when a row has a `+` symbol to expand the tree. Left arrow will collapse the tree.
132131

133-
### Example 9: Output processes to a table view
132+
### Example 9: Output processes to a grid view with streaming
134133

135134
```PowerShell
136-
Get-Process | Out-ConsoleTableView
135+
Get-Process | Out-ConsoleGridView
137136
```
138137

139-
This command gets the processes running on the local computer and sends them to a table view with column headers. The table appears as soon as the first object arrives — rows stream in as the pipeline executes.
138+
This command gets the processes running on the local computer and sends them to an interactive table with column headers. The table appears as soon as the first object arrives — rows stream in as the pipeline executes.
140139

141-
### Example 10: Search for a specific row in the table view
140+
### Example 10: Search for a specific row in the grid view
142141

143142
```PowerShell
144-
Get-Service | octv -Search "wuauserv" -Focus Filter
143+
Get-Service | ocgv -Search "wuauserv" -Focus Filter
145144
```
146145

147-
This command displays all services in a table view, positions the cursor on the first row matching "wuauserv", and starts with focus in the filter field.
146+
This command displays all services in a grid view, positions the cursor on the first row matching "wuauserv", and starts with focus in the filter field.
148147

149148
## Development
150149

@@ -220,7 +219,7 @@ to learn more.
220219

221220
`ConsoleGuiTools` consists of 2 .NET Projects:
222221

223-
* ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView, Out-ConsoleTableView, and Show-ObjectTree
222+
* ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView and Show-ObjectTree
224223
* OutGridView.Models - Contains data contracts between the GUI & Cmdlet
225224

226225
_Note:_ Previously, this repo included `Microsoft.PowerShell.GraphicalTools` which included the Avalonia-based `Out-GridView` (implemented in `.\Microsoft.PowerShell.GraphicalTools` and `.\OutGridView.Gui`). These components have been deprecated (see note above).

docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md

Lines changed: 109 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ external help file: ConsoleGuiToolsModule.dll-Help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: Microsoft.PowerShell.ConsoleGuiTools
6-
ms.date: 08/24/2022
6+
ms.date: 05/04/2026
77
schema: 2.0.0
88
title: Out-ConsoleGridView
99
---
@@ -12,24 +12,25 @@ title: Out-ConsoleGridView
1212

1313
## SYNOPSIS
1414

15-
Sends output to an interactive table in the same console window.
15+
Sends output to an interactive table view with column headers, horizontal scrolling, sorting, and streaming support.
1616

1717
## SYNTAX
1818

1919
```PowerShell
2020
Out-ConsoleGridView [-InputObject <psobject>] [-Title <string>] [-OutputMode {None | Single |
21-
Multiple}] [-Filter <string>] [-MinUi] [-Driver <string>] [-FullScreen] [<CommonParameters>]
21+
Multiple}] [-Filter <string>] [-Search <string>] [-Focus {Table | Filter}] [-MinUI]
22+
[-FullScreen] [-Driver <string>] [<CommonParameters>]
2223
```
2324

2425
## DESCRIPTION
2526

26-
The **Out-ConsoleGridView** cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table.
27+
The **Out-ConsoleGridView** cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table with column headers, column sizing, horizontal scrolling, and column sorting.
2728

28-
Use the Filter box at the top of the window to search the text in the table. Search for text in a particular column, search for literals, and search for multiple words. Use the `-Filter` parameter to pre-populate the Filter box. The filter uses regular expressions.
29+
Use the Filter box at the top of the window to search the text in the table using regular expressions. Unlike the Filter, the `-Search` parameter positions the cursor on the first matching row without hiding non-matching rows.
2930

30-
For instructions for using these features, type `Get-Help Out-ConsoleGridView -Full` and see How to Use the Grid View Window Features in the Notes section.
31+
Objects are streamed into the table as they arrive from the pipeline — the UI appears immediately and rows are added incrementally. A spinner in the status bar indicates loading is in progress.
3132

32-
To send items from the interactive window down the pipeline, click to select the items (either the the mouse in terminals that support mouse or the `SPACE` key) and then press `ENTER`. `ESC` cancels.
33+
To send items from the interactive window down the pipeline, select rows (use arrow keys and `SPACE` or click with the mouse) and then press `ENTER`. Press `ESC` to cancel without output. Use `Ctrl+A` to select all rows, or `Ctrl+D` to deselect all. Click column headers to sort.
3334

3435
## EXAMPLES
3536

@@ -39,7 +40,7 @@ To send items from the interactive window down the pipeline, click to select the
3940
Get-Process | Out-ConsoleGridView
4041
```
4142

42-
This command gets the processes running on the local computer and sends them to a grid view window.
43+
This command gets the processes running on the local computer and sends them to a grid view window with column headers for each property. The table appears as soon as the first object arrives — rows stream in as the pipeline executes.
4344

4445
### Example 2: Use a variable to output processes to a grid view
4546

@@ -54,7 +55,7 @@ The first command uses the Get-Process cmdlet to get the processes on the comput
5455

5556
The second command uses a pipeline operator to send the $P variable to **Out-ConsoleGridView**.
5657

57-
By specifying `-OutputMode Single` the grid view window will be restricted to a single selection, ensuring now more than a single object is returned.
58+
By specifying `-OutputMode Single` the grid view window will be restricted to a single selection, ensuring no more than a single object is returned.
5859

5960
### Example 3: Display a formatted table in a grid view
6061

@@ -109,7 +110,7 @@ killp note
109110
```
110111
This example shows defining a function named `killp` that shows a grid view of all running processes and allows the user to select one to kill it.
111112

112-
The example uses the `-Filter` parameter to filter for all proceses with a name that includes `note` (thus highlighting `Notepad` if it were running. Selecting an item in the grid view and pressing `ENTER` will kill that process.
113+
The example uses the `-Filter` parameter to filter for all processes with a name that includes `note` (thus highlighting `Notepad` if it were running). Selecting an item in the grid view and pressing `ENTER` will kill that process.
113114

114115
### Example 7: Pass multiple items through Out-ConsoleGridView
115116

@@ -130,14 +131,61 @@ Press `F7` to see the history for the current PowerShell instance
130131

131132
Press `Shift-F7` to see the history for all PowerShell instances.
132133

133-
Whatever you select within `Out-ConsoleGridView` will be inserted on your command line.
134+
Whatever you select within `Out-ConsoleGridView` will be inserted on your command line.
134135

135136
Whatever was typed on the command line prior to hitting `F7` or `Shift-F7` will be used as a filter.
136137

138+
### Example 9: Search for a row without filtering
139+
140+
```PowerShell
141+
Get-Service | ocgv -Search "wuauserv"
142+
```
143+
144+
This command displays all services but positions the cursor on the first row matching "wuauserv". Unlike `-Filter`, all rows remain visible.
145+
146+
### Example 10: Start with focus on the filter field
147+
148+
```PowerShell
149+
Get-ChildItem | ocgv -Focus Filter
150+
```
151+
152+
This command opens the grid view with the cursor in the filter text field, ready to type a filter immediately. Pressing `ENTER` while in the filter field accepts the currently selected item(s).
153+
154+
### Example 11: Full screen mode with a custom title
155+
156+
```PowerShell
157+
Get-Process | ocgv -FullScreen -Title "Process Monitor"
158+
```
159+
160+
This command runs the grid view in full-screen mode using the alternate screen buffer, with a custom window title.
161+
162+
### Example 12: Minimal UI for scripting
163+
164+
```PowerShell
165+
Get-Process | ocgv -MinUI -OutputMode Single
166+
```
167+
168+
This command shows the grid view with no window frame, filter box, or status bar — just the table. Useful for quick selection in scripts.
169+
137170
## PARAMETERS
138171

139172
### -Filter
140-
Pre-populates the Filter edit box, allowing filtering to be specified on the command line.
173+
Pre-populates the Filter edit box, hiding rows that do not match the regular expression pattern.
174+
175+
```yaml
176+
Type: String
177+
Parameter Sets: (All)
178+
Aliases:
179+
180+
Required: False
181+
Position: Named
182+
Default value: None
183+
Accept pipeline input: False
184+
Accept wildcard characters: False
185+
```
186+
187+
### -Search
188+
Positions the cursor on the first row matching this regular expression pattern. Unlike `-Filter`, non-matching rows remain visible.
141189

142190
```yaml
143191
Type: String
@@ -151,12 +199,31 @@ Accept pipeline input: False
151199
Accept wildcard characters: False
152200
```
153201

202+
### -Focus
203+
Specifies which UI element receives initial focus.
204+
205+
- **Table** (default): The table view receives focus. Use arrow keys to navigate immediately.
206+
- **Filter**: The filter text field receives focus. Start typing to filter. Press `ENTER` to accept the selected item(s).
207+
208+
```yaml
209+
Type: FocusTarget
210+
Parameter Sets: (All)
211+
Aliases:
212+
Accepted values: Table, Filter
213+
214+
Required: False
215+
Position: Named
216+
Default value: Table
217+
Accept pipeline input: False
218+
Accept wildcard characters: False
219+
```
220+
154221
### -InputObject
155222
Specifies that the cmdlet accepts input for **Out-ConsoleGridView**.
156223

157224
When you use the **InputObject** parameter to send a collection of objects to **Out-ConsoleGridView**, **Out-ConsoleGridView** treats the collection as one collection object, and it displays one row that represents the collection.
158225

159-
To display the each object in the collection, use a pipeline operator (|) to send objects to **Out-ConsoleGridView**.
226+
To display each object in the collection, use a pipeline operator (|) to send objects to **Out-ConsoleGridView**.
160227

161228
```yaml
162229
Type: PSObject
@@ -174,13 +241,13 @@ Accept wildcard characters: False
174241
Specifies the items that the interactive window sends down the pipeline as input to other commands.
175242
By default, this cmdlet generates zero, one, or many items.
176243

177-
To send items from the interactive window down the pipeline, click to select the items (either the the mouse in terminals that support mouse or the `SPACE` key) and then press `ENTER`. `ESC` cancels.
244+
To send items from the interactive window down the pipeline, select items and press `ENTER`. `ESC` cancels.
178245

179246
The values of this parameter determine how many items you can send down the pipeline.
180247

181-
- None. No items.
182-
- Single. Zero items or one item. Use this value when the next command can take only one input object.
183-
- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input objects. This is the default value.
248+
- None. No items.
249+
- Single. Zero items or one item. Use this value when the next command can take only one input object.
250+
- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input objects. This is the default value.
184251

185252
```yaml
186253
Type: OutputModeOption
@@ -212,8 +279,8 @@ Accept pipeline input: False
212279
Accept wildcard characters: False
213280
```
214281

215-
### -MinUi
216-
If specified no title or status bar will be displayed in the **Out-ConsoleGridView** window. The filter will only be displayed if `-Filter` is specified.
282+
### -MinUI
283+
If specified, no window frame, filter box, or status bar will be displayed. The table is shown without chrome.
217284

218285
```yaml
219286
Type: SwitchParameter
@@ -228,22 +295,22 @@ Accept wildcard characters: False
228295
```
229296

230297
### -Driver
231-
Sets the Terminal.Gui driver to use. Valid values are `ansi`, `windows`, or `unix`. The default is `ansi`.
298+
Sets the Terminal.Gui driver to use. Valid values are `ansi`, `windows`, or `unix`.
232299

233300
```yaml
234301
Type: String
235302
Parameter Sets: (All)
236-
Aliases:
303+
Aliases: ForceDriver
237304
238305
Required: False
239306
Position: Named
240-
Default value: ansi
307+
Default value: None
241308
Accept pipeline input: False
242309
Accept wildcard characters: False
243310
```
244311

245312
### -FullScreen
246-
If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline.
313+
If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline in the current terminal.
247314

248315
```yaml
249316
Type: SwitchParameter
@@ -258,30 +325,40 @@ Accept wildcard characters: False
258325
```
259326

260327
### CommonParameters
261-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
328+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
262329

263330
## INPUTS
264331

265332
### System.Management.Automation.PSObject
266333

267-
You can send any object to this cmdlet.
334+
You can send any object to this cmdlet. Objects are streamed — the UI appears as soon as the first object arrives.
268335

269336
## OUTPUTS
270337

271338
### System.Object
272339

273-
By default `Out-ConsoleGridView` returns objects representing the selected rows to the pipeline. Use `-OutputMode` to change this behavior.
340+
By default **Out-ConsoleGridView** returns objects representing the selected rows to the pipeline. Use `-OutputMode` to change this behavior.
274341

275342
## NOTES
276343

277-
* The command output that you send to **Out-ConsoleGridView** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
344+
* **Out-ConsoleGridView** uses Terminal.Gui's `TableView` control which provides column headers, column sizing, horizontal scrolling, column sorting, and native multi-row selection.
278345

279-
* Deserialized output from remote commands might not be formatted correctly in the grid view window.
346+
* The alias for **Out-ConsoleGridView** is `ocgv`.
280347

281-
## RELATED LINKS
348+
* Objects are streamed into the table as they arrive from the pipeline. The UI appears immediately on the first object and rows are added incrementally. A spinner in the status bar indicates loading is in progress.
282349

283-
[Out-File](Out-File.md)
350+
* The command output that you send to **Out-ConsoleGridView** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
351+
352+
* Keyboard shortcuts:
353+
- `ENTER` — Accept selection and close
354+
- `ESC` — Cancel and close
355+
- `Ctrl+A` — Select all rows (when OutputMode is Multiple)
356+
- `Ctrl+D` — Deselect all rows (when OutputMode is Multiple)
357+
- `Home`/`End` — Jump to first/last row
358+
- Arrow keys — Navigate rows and columns
359+
- `Tab` — Move focus between filter and table
360+
- Click column headers — Sort by that column
284361

285-
[Out-Printer](Out-Printer.md)
362+
## RELATED LINKS
286363

287-
[Out-String](Out-String.md)
364+
[Show-ObjectTree](Show-ObjectTree.md)

0 commit comments

Comments
 (0)