diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml
index b20a0ce..830729c 100644
--- a/.github/workflows/ci-test.yml
+++ b/.github/workflows/ci-test.yml
@@ -34,7 +34,7 @@ jobs:
- name: Build and test
shell: pwsh
- run: Invoke-Build -Configuration Release Build, Package
+ run: Invoke-Build -Configuration Release Build, Test, Package
- name: Upload module
if: always()
diff --git a/.gitignore b/.gitignore
index 80046ed..c88f4ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,12 @@ bin/
obj/
publish/
*.sln
+
+# IDE support (keep locally, don't track)
+/.vs/
+*.user
+*.suo
+*.sln.DotSettings
+Properties/launchSettings.json
+nuget.local.config
+GraphicalTools.Dev.slnx
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..a3ae239
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,7 @@
+{
+ "recommendations": [
+ "ms-dotnettools.csdevkit",
+ "ms-dotnettools.csharp",
+ "ms-vscode.powershell"
+ ]
+}
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..19408eb
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,40 @@
+{
+ // Single debug profile that prompts for a sample command at launch.
+ // Add new scenarios by appending an option to the "sampleCommand" input below.
+ "version": "0.2.0",
+ "inputs": [
+ {
+ "id": "sampleCommand",
+ "type": "pickString",
+ "description": "Sample command to run after importing the module",
+ "default": "Get-Process | Out-ConsoleGridView -Debug",
+ "options": [
+ "Get-Process | Out-ConsoleGridView -Debug",
+ "Get-Process | Select-Object ProcessName, Id, CPU | Out-ConsoleGridView -Debug -Filter com",
+ "Get-Process | Out-ConsoleGridView -MinUi",
+ "Get-Process | Select-Object ProcessName, Id, Handles, NPM, PM, WS, CPU | Out-ConsoleGridView",
+ "Get-ChildItem | Out-ConsoleGridView -OutputMode Single",
+ "Get-Process | Show-ObjectTree"
+ ]
+ }
+ ],
+ "configurations": [
+ {
+ "name": "ConsoleGuiTools",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ "program": "pwsh",
+ "args": [
+ "-NoProfile",
+ "-NoLogo",
+ "-NoExit",
+ "-Command",
+ "Import-Module ${workspaceFolder}/module/Microsoft.PowerShell.ConsoleGuiTools.psd1; ${input:sampleCommand}"
+ ],
+ "cwd": "${workspaceFolder}",
+ "console": "integratedTerminal",
+ "stopAtEntry": false
+ }
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..23830fb
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "git.ignoreLimitWarning": true
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..ff8628d
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,60 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "detail": "Build module via Invoke-Build (copies to ./module/)",
+ "type": "process",
+ "command": "pwsh",
+ "args": [
+ "-NoProfile",
+ "-Command",
+ "Invoke-Build Build"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}"
+ },
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ },
+ "presentation": {
+ "reveal": "silent",
+ "panel": "shared",
+ "clear": true
+ },
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "test",
+ "detail": "Run xunit tests via dotnet test (resolves GraphicalTools.slnx)",
+ "type": "process",
+ "command": "dotnet",
+ "args": [
+ "test"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}"
+ },
+ "group": {
+ "kind": "test",
+ "isDefault": true
+ },
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "clean",
+ "type": "process",
+ "command": "pwsh",
+ "args": [
+ "-NoProfile",
+ "-Command",
+ "Invoke-Build Clean"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}"
+ },
+ "problemMatcher": []
+ }
+ ]
+}
diff --git a/ConsoleGuiTools.Common.props b/ConsoleGuiTools.Common.props
index 390d688..7db7c9b 100644
--- a/ConsoleGuiTools.Common.props
+++ b/ConsoleGuiTools.Common.props
@@ -1,6 +1,6 @@
- 0.7.7
+ 1.0.0
Microsoft
© Microsoft Corporation.
diff --git a/ConsoleGuiTools.build.ps1 b/ConsoleGuiTools.build.ps1
index 3fa225b..e33e413 100644
--- a/ConsoleGuiTools.build.ps1
+++ b/ConsoleGuiTools.build.ps1
@@ -23,15 +23,18 @@ task Build {
Push-Location src/Microsoft.PowerShell.ConsoleGuiTools
Invoke-BuildExec { & dotnet publish --configuration $Configuration --output publish }
- $Assets = $(
- "./publish/Microsoft.PowerShell.ConsoleGuiTools.dll",
- "./publish/Microsoft.PowerShell.ConsoleGuiTools.psd1",
- "./publish/Microsoft.PowerShell.OutGridView.Models.dll",
- "./publish/Terminal.Gui.dll",
- "./publish/NStack.dll")
- $Assets | ForEach-Object {
- Copy-Item -Force -Path $_ -Destination ../../module
+
+ # Copy all DLLs except PowerShell SDK dependencies (those are provided by PowerShell itself)
+ Get-ChildItem "./publish/*.dll" | Where-Object {
+ $_.Name -notlike "System.Management.Automation.dll" -and
+ $_.Name -notlike "Microsoft.PowerShell.Commands.Diagnostics.dll" -and
+ $_.Name -notlike "Microsoft.Management.Infrastructure.CimCmdlets.dll"
+ } | ForEach-Object {
+ Copy-Item -Force -Path $_.FullName -Destination ../../module
}
+
+ # Copy the module manifest
+ Copy-Item -Force -Path "./publish/Microsoft.PowerShell.ConsoleGuiTools.psd1" -Destination ../../module
Pop-Location
$Assets = $(
@@ -45,6 +48,10 @@ task Build {
New-ExternalHelp -Path docs/Microsoft.PowerShell.ConsoleGuiTools -OutputPath module/en-US -Force
}
+task Test {
+ Invoke-BuildExec { & dotnet test GraphicalTools.slnx --configuration $Configuration }
+}
+
task Package {
New-Item -ItemType Directory -Force ./out | Out-Null
if (-Not (Get-PSResourceRepository -Name ConsoleGuiTools -ErrorAction SilentlyContinue)) {
@@ -53,4 +60,4 @@ task Package {
Publish-PSResource -Path ./module -Repository ConsoleGuiTools -Verbose
}
-task . Clean, Build
+task . Clean, Build, Test
diff --git a/Directory.Build.props b/Directory.Build.props
index 1932808..0f11888 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,5 +1,8 @@
true
+
+ $(MSBuildThisFileDirectory)nuget.local.config
diff --git a/Directory.Packages.props b/Directory.Packages.props
index be0590b..a10e43c 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -1,8 +1,13 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/GraphicalTools.slnx b/GraphicalTools.slnx
new file mode 100644
index 0000000..b4c8b8f
--- /dev/null
+++ b/GraphicalTools.slnx
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/README.md b/README.md
index 71bf677..538333c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# ConsoleGuiTools - `Out-ConsoleGridView` and `Show-ObjectTree`
-This repo contains the `Out-ConsoleGridView`
-PowerShell Cmdlet providing console-based GUI experiences based on
+This repo contains the `Out-ConsoleGridView` and `Show-ObjectTree`
+PowerShell Cmdlets providing console-based GUI experiences based on
[Terminal.Gui (gui.cs)](https://github.com/gui-cs/Terminal.Gui).
_Note:_ A module named `Microsoft.PowerShell.GraphicalTools` used to be built and published out of this repo, but per [#101](https://github.com/PowerShell/ConsoleGuiTools/issues/101) it is deprecated and unmaintained until such time that it can be rewritten on top of [.NET MAUI](https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/).
@@ -14,7 +14,7 @@ Install-Module Microsoft.PowerShell.ConsoleGuiTools
## Features
-* [`Out-ConsoleGridview`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) - Send objects to a grid view window for interactive filtering and sorting.
+* [`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.
* [`Show-ObjectTree`](docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md) - Send objects to a tree view window for interactive filtering and sorting.
* Cross-platform - Works on any platform that supports PowerShell 7.2+.
@@ -122,18 +122,34 @@ Whatever was typed on the command line prior to hitting `F7` or `Shift-F7` will
### Example 8: Output processes to a tree view
```PowerShell
-PS C:\> Get-Process | Show-ObjectTree
+Get-Process | Show-ObjectTree
```
This command gets the processes running on the local computer and sends them to a tree view window.
Use right arrow when a row has a `+` symbol to expand the tree. Left arrow will collapse the tree.
+### Example 9: Output processes to a grid view with streaming
+
+```PowerShell
+Get-Process | Out-ConsoleGridView
+```
+
+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.
+
+### Example 10: Search for a specific row in the grid view
+
+```PowerShell
+Get-Service | ocgv -Search "wuauserv" -Focus Filter
+```
+
+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.
+
## Development
-### 1. Install PowerShell 7.2+
+### 1. Install PowerShell 7.6+
-Install PowerShell 7.2+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).
+Install PowerShell 7.6+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).
### 2. Clone the GitHub repository
@@ -203,7 +219,7 @@ to learn more.
`ConsoleGuiTools` consists of 2 .NET Projects:
-* ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView
+* ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView and Show-ObjectTree
* OutGridView.Models - Contains data contracts between the GUI & Cmdlet
_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).
diff --git a/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md b/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
index 895bce4..6805c04 100644
--- a/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
+++ b/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
@@ -3,7 +3,7 @@ external help file: ConsoleGuiToolsModule.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.ConsoleGuiTools
-ms.date: 08/24/2022
+ms.date: 05/04/2026
schema: 2.0.0
title: Out-ConsoleGridView
---
@@ -12,42 +12,41 @@ title: Out-ConsoleGridView
## SYNOPSIS
-Sends output to an interactive table in the same console window.
+Sends output to an interactive table view with column headers, horizontal scrolling, sorting, and streaming support.
## SYNTAX
```PowerShell
Out-ConsoleGridView [-InputObject ] [-Title ] [-OutputMode {None | Single |
- Multiple}] [-Filter ] [-MinUi] []
+ Multiple}] [-Filter ] [-Search ] [-Focus {Table | Filter}] [-MinUI]
+ [-FullScreen] [-Driver ] []
```
## DESCRIPTION
-The **Out-ConsoleGridView** cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table.
+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.
-You can use the following features of the table to examine your data:
+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.
-- Quick Filter. Use the Filter box at the top of the window to search the text in the table. You can search for text in a particular column, search for literals, and search for multiple words. You can use the `-Filter` command to pre-populate the Filter box. The filter uses regular expressions.
+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.
-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.
-
-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.
+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.
## EXAMPLES
### Example 1: Output processes to a grid view
```PowerShell
-PS C:\> Get-Process | Out-ConsoleGridView
+Get-Process | Out-ConsoleGridView
```
-This command gets the processes running on the local computer and sends them to a grid view window.
+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.
### Example 2: Use a variable to output processes to a grid view
```PowerShell
-PS C:\> $P = Get-Process
-PS C:\> $P | Out-ConsoleGridView -OutputMode Single
+$P = Get-Process
+$P | Out-ConsoleGridView -OutputMode Single
```
This command also gets the processes running on the local computer and sends them to a grid view window.
@@ -56,12 +55,12 @@ The first command uses the Get-Process cmdlet to get the processes on the comput
The second command uses a pipeline operator to send the $P variable to **Out-ConsoleGridView**.
-By specifying `-OutputMode Single` the grid view window will be restricted to a single selection, ensuring now more than a single object is returned.
+By specifying `-OutputMode Single` the grid view window will be restricted to a single selection, ensuring no more than a single object is returned.
### Example 3: Display a formatted table in a grid view
```PowerShell
-PS C:\> Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView
+Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView
```
This command displays a formatted table in a grid view window.
@@ -80,7 +79,7 @@ You can now use the features of the grid view to search, sort, and filter the da
### Example 4: Save output to a variable, and then output a grid view
```PowerShell
-PS C:\> ($A = Get-ChildItem -Path $pshome -Recurse) | Out-ConsoleGridView
+($A = Get-ChildItem -Path $pshome -Recurse) | Out-ConsoleGridView
```
This command saves its output in a variable and sends it to **Out-ConsoleGridView**.
@@ -96,7 +95,7 @@ As a result, the output from the Get-ChildItem command is saved in the $A variab
### Example 5: Output processes for a specified computer to a grid view
```PowerShell
-PS C:\> Get-Process -ComputerName "Server01" | ocgv -Title "Processes - Server01"
+Get-Process -ComputerName "Server01" | ocgv -Title "Processes - Server01"
```
This command displays the processes that are running on the Server01 computer in a grid view window.
@@ -106,24 +105,23 @@ The command uses `ocgv`, which is the built-in alias for the **Out-ConsoleGridVi
### Example 6: Define a function to kill processes using a graphical chooser
```PowerShell
-PS C:\> function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
-PS C:\> killp note
+function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
+killp note
```
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.
-The example uses the `-Filter` paramter 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.
+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.
### Example 7: Pass multiple items through Out-ConsoleGridView
```PowerShell
-PS C:\> Get-Process | Out-ConsoleGridView -PassThru | Export-Csv -Path .\ProcessLog.csv
+Get-Process | Out-ConsoleGridView -OutputMode Multiple | Export-Csv -Path .\ProcessLog.csv
```
This command lets you select multiple processes from the **Out-ConsoleGridView** window.
The processes that you select are passed to the **Export-Csv** command and written to the ProcessLog.csv file.
-The command uses the *PassThru* parameter of **Out-ConsoleGridView**, which lets you send multiple items down the pipeline.
-The *PassThru* parameter is equivalent to using the Multiple value of the *OutputMode* parameter.
+By default, `-OutputMode` is `Multiple`, which lets you send multiple items down the pipeline.
### Example 8: Use F7 as "Show Command History"
@@ -133,14 +131,46 @@ Press `F7` to see the history for the current PowerShell instance
Press `Shift-F7` to see the history for all PowerShell instances.
-Whatever you select within `Out-ConsoleGridView` will be inserted on your command line.
+Whatever you select within `Out-ConsoleGridView` will be inserted on your command line.
Whatever was typed on the command line prior to hitting `F7` or `Shift-F7` will be used as a filter.
+### Example 9: Search for a row without filtering
+
+```PowerShell
+Get-Service | ocgv -Search "wuauserv"
+```
+
+This command displays all services but positions the cursor on the first row matching "wuauserv". Unlike `-Filter`, all rows remain visible.
+
+### Example 10: Start with focus on the filter field
+
+```PowerShell
+Get-ChildItem | ocgv -Focus Filter
+```
+
+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).
+
+### Example 11: Full screen mode with a custom title
+
+```PowerShell
+Get-Process | ocgv -FullScreen -Title "Process Monitor"
+```
+
+This command runs the grid view in full-screen mode using the alternate screen buffer, with a custom window title.
+
+### Example 12: Minimal UI for scripting
+
+```PowerShell
+Get-Process | ocgv -MinUI -OutputMode Single
+```
+
+This command shows the grid view with no window frame, filter box, or status bar — just the table. Useful for quick selection in scripts.
+
## PARAMETERS
### -Filter
-Pre-populates the Filter edit box, allowing filtering to be specified on the command line.
+Pre-populates the Filter edit box, hiding rows that do not match the regular expression pattern.
```yaml
Type: String
@@ -154,12 +184,46 @@ Accept pipeline input: False
Accept wildcard characters: False
```
+### -Search
+Positions the cursor on the first row matching this regular expression pattern. Unlike `-Filter`, non-matching rows remain visible.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Focus
+Specifies which UI element receives initial focus.
+
+- **Table** (default): The table view receives focus. Use arrow keys to navigate immediately.
+- **Filter**: The filter text field receives focus. Start typing to filter. Press `ENTER` to accept the selected item(s).
+
+```yaml
+Type: FocusTarget
+Parameter Sets: (All)
+Aliases:
+Accepted values: Table, Filter
+
+Required: False
+Position: Named
+Default value: Table
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
### -InputObject
Specifies that the cmdlet accepts input for **Out-ConsoleGridView**.
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.
-To display the each object in the collection, use a pipeline operator (|) to send objects to **Out-ConsoleGridView**.
+To display each object in the collection, use a pipeline operator (|) to send objects to **Out-ConsoleGridView**.
```yaml
Type: PSObject
@@ -177,13 +241,13 @@ Accept wildcard characters: False
Specifies the items that the interactive window sends down the pipeline as input to other commands.
By default, this cmdlet generates zero, one, or many items.
-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.
+To send items from the interactive window down the pipeline, select items and press `ENTER`. `ESC` cancels.
The values of this parameter determine how many items you can send down the pipeline.
-- None. No items.
-- Single. Zero items or one item. Use this value when the next command can take only one input object.
-- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input objects. This is the default value.
+- None. No items.
+- Single. Zero items or one item. Use this value when the next command can take only one input object.
+- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input objects. This is the default value.
```yaml
Type: OutputModeOption
@@ -215,8 +279,38 @@ Accept pipeline input: False
Accept wildcard characters: False
```
-### -MinUi
-If specified no window frame, filter box, or status bar will be displayed in the **Out-ConsoleGridView** window.
+### -MinUI
+If specified, no window frame, filter box, or status bar will be displayed. The table is shown without chrome.
+
+```yaml
+Type: SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Driver
+Sets the Terminal.Gui driver to use. Valid values are `ansi`, `windows`, or `unix`.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases: ForceDriver
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -FullScreen
+If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline in the current terminal.
```yaml
Type: SwitchParameter
@@ -231,30 +325,40 @@ Accept wildcard characters: False
```
### CommonParameters
-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).
+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).
## INPUTS
### System.Management.Automation.PSObject
-You can send any object to this cmdlet.
+You can send any object to this cmdlet. Objects are streamed — the UI appears as soon as the first object arrives.
## OUTPUTS
### System.Object
-By default `Out-ConsoleGridView` returns objects representing the selected rows to the pipeline. Use `-OutputMode` to change this behavior.
+By default **Out-ConsoleGridView** returns objects representing the selected rows to the pipeline. Use `-OutputMode` to change this behavior.
## NOTES
-* 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.
+* **Out-ConsoleGridView** uses Terminal.Gui's `TableView` control which provides column headers, column sizing, horizontal scrolling, column sorting, and native multi-row selection.
-* Deserialized output from remote commands might not be formatted correctly in the grid view window.
+* The alias for **Out-ConsoleGridView** is `ocgv`.
-## RELATED LINKS
+* 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.
+
+* 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.
-[Out-File](Out-File.md)
+* Keyboard shortcuts:
+ - `ENTER` — Accept selection and close
+ - `ESC` — Cancel and close
+ - `Ctrl+A` — Select all rows (when OutputMode is Multiple)
+ - `Ctrl+D` — Deselect all rows (when OutputMode is Multiple)
+ - `Home`/`End` — Jump to first/last row
+ - Arrow keys — Navigate rows and columns
+ - `Tab` — Move focus between filter and table
+ - Click column headers — Sort by that column
-[Out-Printer](Out-Printer.md)
+## RELATED LINKS
-[Out-String](Out-String.md)
+[Show-ObjectTree](Show-ObjectTree.md)
diff --git a/docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md b/docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md
index d7bde95..87b9aa1 100644
--- a/docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md
+++ b/docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md
@@ -17,16 +17,14 @@ Sends output to an interactive tree in the same console window.
## SYNTAX
```PowerShell
-Show-ObjectTree [-InputObject ] [-Title ] [-Filter ] [-MinUi] [-UseNetDriver] []
+Show-ObjectTree [-InputObject ] [-Title ] [-Filter ] [-MinUi] [-Driver ] [-FullScreen] []
```
## DESCRIPTION
The **Show-ObjectTree** cmdlet sends the output from a command to a tree view window where the output is displayed in an interactive tree.
-You can use the following features of the tree to examine your data:
-
-- Quick Filter. Use the Filter box at the top of the window to search the text in the tree. You can search for literals or multiple words. You can use the `-Filter` command to pre-populate the Filter box. The filter uses regular expressions.
+Use the Filter box at the top of the window to search the text in the tree including literals or multiple words. Use the `-Filter` parameter to pre-populate the Filter box. The filter uses regular expressions.
For instructions for using these features, type `Get-Help Show-ObjectTree -Full` and see How to Use the Tree View Window Features in the Notes section.
@@ -35,7 +33,7 @@ For instructions for using these features, type `Get-Help Show-ObjectTree -Full`
### Example 1: Output processes to a tree view
```PowerShell
-PS C:\> Get-Process | Show-ObjectTree
+Get-Process | Show-ObjectTree
```
This command gets the processes running on the local computer and sends them to a tree view window.
@@ -43,12 +41,13 @@ This command gets the processes running on the local computer and sends them to
### Example 2: Save output to a variable, and then output a tree view
```PowerShell
-PS C:\> ($A = Get-ChildItem -Path $pshome -Recurse) | shot
+($A = Get-ChildItem -Path $pshome -Recurse) | shot
```
This command saves its output in a variable and sends it to **Show-ObjectTree**.
The command uses the Get-ChildItem cmdlet to get the files in the Windows PowerShell installation directory and its subdirectories.
+
The path to the installation directory is saved in the $pshome automatic variable.
The command uses the assignment operator (=) to save the output in the $A variable and the pipeline operator (|) to send the output to **Show-ObjectTree**.
@@ -76,7 +75,7 @@ Accept wildcard characters: False
### -InputObject
Specifies that the cmdlet accepts input for **Show-ObjectTree**.
-When you use the **InputObject** parameter to send a collection of objects to **Show-ObjectTree**, **Show-ObjectTree** treats the collection as one collection object, and it displays one row that represents the collection.
+The **InputObject** parameter enables sending a collection of objects to **Show-ObjectTree**, **Show-ObjectTree** treats the collection as one collection object, and it displays one row that represents the collection.
To display the each object in the collection, use a pipeline operator (|) to send objects to **Show-ObjectTree**.
@@ -110,7 +109,37 @@ Accept wildcard characters: False
```
### -MinUi
-If specified no window frame, filter box, or status bar will be displayed in the **Show-ObjectTree** window.
+If specified no title or status bar will be displayed in the **Show-ObjectTree** window. The filter will only be displayed if `-Filter` is specified.
+
+```yaml
+Type: SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Driver
+Specifies the Terminal.Gui driver to use. Valid values are `ansi`, `windows`, or `unix`. The default is `ansi`.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: ansi
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -FullScreen
+If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline.
```yaml
Type: SwitchParameter
@@ -141,7 +170,7 @@ You can send any object to this cmdlet.
## NOTES
-* The command output that you send to **Show-ObjectTree** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
+* The command output sent to **Show-ObjectTree** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
* Deserialized output from remote commands might not be formatted correctly in the tree view window.
diff --git a/global.json b/global.json
index 19e4d7e..a1ce647 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "8.0.405",
+ "version": "10.0.101",
"rollForward": "latestFeature",
"allowPrerelease": false
}
diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/CachedMemberResult.cs b/src/Microsoft.PowerShell.ConsoleGuiTools/CachedMemberResult.cs
new file mode 100644
index 0000000..14534c5
--- /dev/null
+++ b/src/Microsoft.PowerShell.ConsoleGuiTools/CachedMemberResult.cs
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace Microsoft.PowerShell.ConsoleGuiTools;
+
+///
+/// Represents a cached reflection result for a property or field member, including its value and collection details.
+///
+internal sealed class CachedMemberResult
+{
+ #region Fields
+
+ private readonly string? _representation;
+ private List? _valueAsList;
+
+ #endregion
+
+ #region Properties
+
+ ///
+ /// Gets or sets the member information (property or field) that was accessed.
+ ///
+ public MemberInfo Member { get; set; }
+
+ ///
+ /// Gets or sets the value retrieved from the member.
+ ///
+ public object? Value { get; set; }
+
+ ///
+ /// Gets or sets the parent object that contains this member.
+ ///
+ public object Parent { get; set; }
+
+ ///
+ /// Gets a value indicating whether this member's value is a collection.
+ ///
+ public bool IsCollection => _valueAsList != null;
+
+ ///
+ /// Gets the collection elements if this member's value is a collection; otherwise, .
+ ///
+ public IReadOnlyCollection? Elements => _valueAsList?.AsReadOnly();
+
+ #endregion
+
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class by reflecting on the specified member.
+ ///
+ /// The parent object containing the member.
+ /// The member information to retrieve the value from.
+ public CachedMemberResult(object parent, MemberInfo mem)
+ {
+ Parent = parent;
+ Member = mem;
+
+ try
+ {
+ if (mem is PropertyInfo p)
+ Value = p.GetValue(parent);
+ else if (mem is FieldInfo f)
+ Value = f.GetValue(parent);
+ else
+ throw new NotSupportedException($"Unknown {nameof(MemberInfo)} Type");
+
+ _representation = ValueToString();
+ }
+ catch (Exception)
+ {
+ Value = _representation = "Unavailable";
+ }
+ }
+
+ #endregion
+
+ #region Overrides
+
+ ///
+ /// Returns a string representation of this member in the format "MemberName: value".
+ ///
+ /// A formatted string showing the member name and value.
+ public override string ToString() => Member.Name + ": " + _representation;
+
+ #endregion
+
+ #region Private Methods
+
+ ///
+ /// Converts the member's value to a string representation, detecting collections and formatting them appropriately.
+ ///
+ /// A string representation of the value.
+ private string? ValueToString()
+ {
+ if (Value == null)
+ return "Null";
+
+ try
+ {
+ if (IsCollectionOfKnownTypeAndSize(out var elementType, out var size))
+ return $"{elementType!.Name}[{size}]";
+ }
+ catch (Exception)
+ {
+ return Value?.ToString();
+ }
+
+ return Value?.ToString();
+ }
+
+ ///
+ /// Determines whether the value is a collection of a known type and caches the collection elements.
+ ///
+ /// When this method returns, contains the element type if the value is a homogeneous collection; otherwise, .
+ /// When this method returns, contains the size of the collection if applicable; otherwise, 0.
+ /// if the value is a collection of a single known type; otherwise, .
+ private bool IsCollectionOfKnownTypeAndSize(out Type? elementType, out int size)
+ {
+ elementType = null;
+ size = 0;
+
+ if (Value is null or string)
+ return false;
+
+ if (Value is IEnumerable enumerable)
+ {
+ var list = enumerable.Cast