diff --git a/Build.ps1 b/Build.ps1 index c527a93..42b6507 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -26,6 +26,7 @@ if ($psd1Content) { } "Rewriting $PsdPath with new ModuleVersion: $ModuleVersion" $updatedpsd1Content = $psd1Content -replace "ModuleVersion\s+=\s+'([\d\.]+)'", "ModuleVersion = '$ModuleVersion'" + $updatedpsd1Content = $updatedpsd1Content.TrimEnd() $updatedpsd1Content | Out-File -FilePath $PsdPath -Encoding ascii } else { diff --git a/README.md b/README.md index 03cb49e..b9e8220 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# GraphicalTools - `Out-ConsoleGridView` +# ConsoleGuiTools - `Out-ConsoleGridView` and `Show-ObjectTree` -The GraphicalTools repo contains the `Out-ConsoleGridView` +This repo contains the `Out-ConsoleGridView` PowerShell Cmdlet providing console-based GUI experiences based on [Terminal.Gui (gui.cs)](https://github.com/gui-cs/Terminal.Gui). @@ -14,11 +14,17 @@ Install-Module Microsoft.PowerShell.ConsoleGuiTools ## Features -Cross-platform! Use the cmdlet -[`Out-ConsoleGridview`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) -to view and filter objects graphically. +* [`Out-ConsoleGridview`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) - Send objects to a grid view window for interactive filtering and sorting. +* [`Show-ObjectTree`](docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md) - Send objects to a tree view window for interactive filtering and sorting. -![screenshot of Out-ConsoleGridView](docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif) +* Cross-platform - Works on any platform that supports PowerShell 7.2+. +* Interactive - Use the mouse and keyboard to interact with the grid or tree view. +* Filtering - Filter the data using the built-in filter box. +* Sorting - Sort the data by clicking on the column headers. +* Multiple Selection - Select multiple items and send them down the pipeline. +* Customizable - Customize the grid view window with the built-in parameters. + +![Demo GIF](docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif) ## Examples @@ -124,6 +130,16 @@ Whatever you select within `Out-ConsoleGridView` will be inserted on your comman Whatever was typed on the command line prior to hitting `F7` or `Shift-F7` will be used as a filter. +### Example 9: Output processes to a tree view + +```PowerShell +PS C:\> 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. + ## Development ### 1. Install PowerShell 7.2+ diff --git a/demo.ps1 b/demo.ps1 index 4875889..7c7c700 100644 --- a/demo.ps1 +++ b/demo.ps1 @@ -14,4 +14,7 @@ killp killp note # .Silent cls # Example 4: Navigate PowerShell command history (Map this to F7 with https://github.com/gui-cs/F7History) -Get-History | Sort-Object -Descending -Property Id -Unique | Select-Object CommandLine -ExpandProperty CommandLine | Out-ConsoleGridView -OutputMode Single -Filter $line -Title "Command Line History" \ No newline at end of file +Get-History | Sort-Object -Descending -Property Id -Unique | Select-Object CommandLine -ExpandProperty CommandLine | Out-ConsoleGridView -OutputMode Single -Filter $line -Title "Command Line History" +# .Silent cls +# Example 4: Use Show-ObjectTree to output processes to a tree view +Get-Process | Show-ObjectTree diff --git a/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif b/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif index d70139a..ac4212a 100644 Binary files a/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif and b/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif differ diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 index 646c197..ac07d4f 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 @@ -10,7 +10,7 @@ RootModule = 'Microsoft.PowerShell.ConsoleGuiTools.dll' # Version number of this module. # NOTE: This will get updated by build.ps1; the build number will be incremented for each build. -ModuleVersion = '0.7.5.35' +ModuleVersion = '0.7.5.38' # Supported PSEditions CompatiblePSEditions = @( 'Core' )