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..4f43da1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,13 @@ bin/
obj/
publish/
*.sln
+*.slnx
+
+# IDE support (keep locally, don't track)
+/.vs/
+/.vscode/
+*.user
+*.suo
+*.sln.DotSettings
+Properties/launchSettings.json
+nuget.local.config
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..8ac146a 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 --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..5bac50a 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -1,8 +1,13 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/GraphicalTools.sln b/GraphicalTools.sln
new file mode 100644
index 0000000..a90b9f7
--- /dev/null
+++ b/GraphicalTools.sln
@@ -0,0 +1,113 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 18
+VisualStudioVersion = 18.6.11716.218 insiders
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerShell.ConsoleGuiTools", "src\Microsoft.PowerShell.ConsoleGuiTools\Microsoft.PowerShell.ConsoleGuiTools.csproj", "{DBAF2B0C-2E02-4698-A788-EB7EB6364404}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerShell.OutGridView.Models", "src\Microsoft.PowerShell.OutGridView.Models\Microsoft.PowerShell.OutGridView.Models.csproj", "{233472F8-D472-4265-813B-B394013A2B60}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerShell.ConsoleGuiTools.Tests", "test\Microsoft.PowerShell.ConsoleGuiTools.Tests\Microsoft.PowerShell.ConsoleGuiTools.Tests.csproj", "{F1E2D3C4-B5A6-7890-ABCD-EF0987654321}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Terminal.Gui", "..\gui-cs\Terminal.Gui\Terminal.Gui\Terminal.Gui.csproj", "{73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Terminal.Gui.Analyzers.Internal", "..\gui-cs\Terminal.Gui\Terminal.Gui.Analyzers.Internal\Terminal.Gui.Analyzers.Internal.csproj", "{45957E57-3576-4EE7-AE19-4AEEA3347007}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BC49DFD5-E542-49BF-B582-41A89281D7E0}"
+ ProjectSection(SolutionItems) = preProject
+ ConsoleGuiTools.build.ps1 = ConsoleGuiTools.build.ps1
+ ConsoleGuiTools.Common.props = ConsoleGuiTools.Common.props
+ Directory.Build.props = Directory.Build.props
+ Directory.Packages.props = Directory.Packages.props
+ global.json = global.json
+ nuget.config = nuget.config
+ README.md = README.md
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|x64.Build.0 = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Debug|x86.Build.0 = Debug|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|x64.ActiveCfg = Release|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|x64.Build.0 = Release|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|x86.ActiveCfg = Release|Any CPU
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404}.Release|x86.Build.0 = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|x64.Build.0 = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Debug|x86.Build.0 = Debug|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|Any CPU.Build.0 = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|x64.ActiveCfg = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|x64.Build.0 = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|x86.ActiveCfg = Release|Any CPU
+ {233472F8-D472-4265-813B-B394013A2B60}.Release|x86.Build.0 = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|x64.Build.0 = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Debug|x86.Build.0 = Debug|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|x64.ActiveCfg = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|x64.Build.0 = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|x86.ActiveCfg = Release|Any CPU
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321}.Release|x86.Build.0 = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|x64.Build.0 = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Debug|x86.Build.0 = Debug|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|Any CPU.Build.0 = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|x64.ActiveCfg = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|x64.Build.0 = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|x86.ActiveCfg = Release|Any CPU
+ {73DD3D02-8DB5-41F6-9FF1-FDCB68D42D88}.Release|x86.Build.0 = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|x64.Build.0 = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Debug|x86.Build.0 = Debug|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|Any CPU.Build.0 = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|x64.ActiveCfg = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|x64.Build.0 = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|x86.ActiveCfg = Release|Any CPU
+ {45957E57-3576-4EE7-AE19-4AEEA3347007}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {DBAF2B0C-2E02-4698-A788-EB7EB6364404} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {233472F8-D472-4265-813B-B394013A2B60} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {F1E2D3C4-B5A6-7890-ABCD-EF0987654321} = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {2FE0632F-98BB-4772-8465-957821A4EE1B}
+ EndGlobalSection
+EndGlobal
diff --git a/README.md b/README.md
index 71bf677..076cfc0 100644
--- a/README.md
+++ b/README.md
@@ -122,7 +122,7 @@ 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.
@@ -131,9 +131,9 @@ Use right arrow when a row has a `+` symbol to expand the tree. Left arrow will
## 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 +203,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..dc1645f 100644
--- a/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
+++ b/docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
@@ -18,16 +18,14 @@ Sends output to an interactive table in the same console window.
```PowerShell
Out-ConsoleGridView [-InputObject ] [-Title ] [-OutputMode {None | Single |
- Multiple}] [-Filter ] [-MinUi] []
+ Multiple}] [-Filter ] [-MinUi] [-Driver ] [-FullScreen] []
```
## 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.
-You can use the following features of the table to examine your data:
-
-- 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.
+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.
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.
@@ -38,7 +36,7 @@ To send items from the interactive window down the pipeline, click to select the
### 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.
@@ -46,8 +44,8 @@ This command gets the processes running on the local computer and sends them to
### 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.
@@ -61,7 +59,7 @@ By specifying `-OutputMode Single` the grid view window will be restricted to a
### 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 +78,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 +94,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 +104,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 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.
### 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"
@@ -216,7 +213,37 @@ Accept wildcard characters: False
```
### -MinUi
-If specified no window frame, filter box, or status bar will be displayed in the **Out-ConsoleGridView** window.
+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.
+
+```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`. 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
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/nuget.config b/nuget.config
index f003b0f..740c072 100644
--- a/nuget.config
+++ b/nuget.config
@@ -1,7 +1,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
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