{"id":15021167,"url":"https://github.com/powershell/consoleguitools","last_synced_at":"2025-05-15T01:08:47.099Z","repository":{"id":38454540,"uuid":"191801383","full_name":"PowerShell/ConsoleGuiTools","owner":"PowerShell","description":"Modules that mix PowerShell and GUIs/CUIs!","archived":false,"fork":false,"pushed_at":"2025-02-26T22:33:32.000Z","size":5773,"stargazers_count":862,"open_issues_count":24,"forks_count":66,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-05-12T06:59:35.973Z","etag":null,"topics":["gui","powershell"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerShell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T16:54:52.000Z","updated_at":"2025-05-10T06:58:55.000Z","dependencies_parsed_at":"2024-01-13T11:13:40.031Z","dependency_job_id":"339e6adb-9dd1-4422-85a4-82c9ad5a1133","html_url":"https://github.com/PowerShell/ConsoleGuiTools","commit_stats":{"total_commits":157,"total_committers":20,"mean_commits":7.85,"dds":0.7515923566878981,"last_synced_commit":"2078bf396871d28c3671ba7aed3d4239d1b58f1f"},"previous_names":["powershell/consoleguitools","powershell/graphicaltools"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FConsoleGuiTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FConsoleGuiTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FConsoleGuiTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FConsoleGuiTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerShell","download_url":"https://codeload.github.com/PowerShell/ConsoleGuiTools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254042,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","powershell"],"created_at":"2024-09-24T19:56:13.014Z","updated_at":"2025-05-15T01:08:42.092Z","avatar_url":"https://github.com/PowerShell.png","language":"C#","readme":"# ConsoleGuiTools - `Out-ConsoleGridView` and `Show-ObjectTree`\n\nThis repo contains the `Out-ConsoleGridView`\nPowerShell Cmdlet providing console-based GUI experiences based on\n[Terminal.Gui (gui.cs)](https://github.com/gui-cs/Terminal.Gui).\n\n_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/).\n\n## Installation\n\n```powershell\nInstall-Module Microsoft.PowerShell.ConsoleGuiTools\n```\n\n## Features\n\n* [`Out-ConsoleGridview`](docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md) - Send objects to a grid view window for interactive filtering and sorting.\n* [`Show-ObjectTree`](docs/Microsoft.PowerShell.ConsoleGuiTools/Show-ObjectTree.md) - Send objects to a tree view window for interactive filtering and sorting.\n\n* Cross-platform - Works on any platform that supports PowerShell 7.2+.\n* Interactive - Use the mouse and keyboard to interact with the grid or tree view.\n* Filtering - Filter the data using the built-in filter box.\n* Sorting - Sort the data by clicking on the column headers.\n* Multiple Selection - Select multiple items and send them down the pipeline.\n* Customizable - Customize the grid view window with the built-in parameters.\n\n![Demo GIF](docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif)\n\n## Examples\n\n### Example 1: Output processes to a grid view\n\n```PowerShell\nGet-Process | Out-ConsoleGridView\n```\n\nThis command gets the processes running on the local computer and sends them to a grid view window.\n\n### Example 2: Use a variable to output processes to a grid view\n\n```PowerShell\n$P = Get-Process\n$P | Out-ConsoleGridView -OutputMode Single\n```\n\nThis command also gets the processes running on the local computer and sends them to a grid view window.\n\nThe first command uses the Get-Process cmdlet to get the processes on the computer and then saves the process objects in the $P variable.\n\nThe second command uses a pipeline operator to send the $P variable to **Out-ConsoleGridView**.\n\nBy specifying `-OutputMode Single` the grid view window will be restricted to a single selection, ensuring no more than a single object is returned.\n\n### Example 3: Display a formatted table in a grid view\n\n```PowerShell\nGet-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView\n```\n\nThis command displays a formatted table in a grid view window.\n\nIt uses the Get-Process cmdlet to get the processes on the computer.\n\nThen, it uses a pipeline operator (|) to send the process objects to the Select-Object cmdlet.\nThe command uses the **Property** parameter of **Select-Object** to select the Name, WorkingSet, and PeakWorkingSet properties to be displayed in the table.\n\nAnother pipeline operator sends the filtered objects to the Sort-Object cmdlet, which sorts them in descending order by the value of the **WorkingSet** property.\n\nThe final part of the command uses a pipeline operator (|) to send the formatted table to **Out-ConsoleGridView**.\n\nYou can now use the features of the grid view to search, sort, and filter the data.\n\n### Example 4: Save output to a variable, and then output a grid view\n\n```PowerShell\n($A = Get-ChildItem -Path $pshome -Recurse) | Out-ConsoleGridView\n```\n\nThis command saves its output in a variable and sends it to **Out-ConsoleGridView**.\n\nThe command uses the Get-ChildItem cmdlet to get the files in the Windows PowerShell installation directory and its subdirectories.\nThe path to the installation directory is saved in the $pshome automatic variable.\n\nThe command uses the assignment operator (=) to save the output in the $A variable and the pipeline operator (|) to send the output to **Out-ConsoleGridView**.\n\nThe parentheses in the command establish the order of operations.\nAs a result, the output from the Get-ChildItem command is saved in the $A variable before it is sent to **Out-ConsoleGridView**.\n\n### Example 5: Output processes for a specified computer to a grid view\n\n```PowerShell\nGet-Process -ComputerName \"Server01\" | ocgv -Title \"Processes - Server01\"\n```\n\nThis command displays the processes that are running on the Server01 computer in a grid view window.\n\nThe command uses `ocgv`, which is the built-in alias for the **Out-ConsoleGridView** cmdlet, it uses the _Title_ parameter to specify the window title.\n\n### Example 6: Define a function to kill processes using a graphical chooser\n\n```PowerShell\nfunction killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }\nkillp note\n```\n\nThis 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.\n\nThe 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.\n\n### Example 7: Use F7 as \"Show Command History\"\n\nAdd [gui-cs/F7History](https://github.com/gui-cs/F7History) to your Powershell profile.\n\nPress `F7` to see the history for the current PowerShell instance\n\nPress `Shift-F7` to see the history for all PowerShell instances.\n\nWhatever you select within `Out-ConsoleGridView` will be inserted on your command line.\n\nWhatever was typed on the command line prior to hitting `F7` or `Shift-F7` will be used as a filter.\n\n### Example 8: Output processes to a tree view\n\n```PowerShell\nPS C:\\\u003e Get-Process | Show-ObjectTree\n```\n\nThis command gets the processes running on the local computer and sends them to a tree view window.\n\nUse right arrow when a row has a `+` symbol to expand the tree. Left arrow will collapse the tree.\n\n## Development\n\n### 1. Install PowerShell 7.2+\n\nInstall PowerShell 7.2+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).\n\n### 2. Clone the GitHub repository\n\n```powershell\ngit clone https://github.com/PowerShell/ConsoleGuiTools.git\n```\n\n### 3. Install [Invoke-Build](https://github.com/nightroman/Invoke-Build)\n\n```powershell\nInstall-Module InvokeBuild -Scope CurrentUser\n```\n\nNow you're ready to build the code.  You can do so in one of two ways:\n\n### 4. Building the code from PowerShell\n\n```powershell\npushd ./ConsoleGuiTools\nInvoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools\npopd\n```\n\nFrom there you can import the module that you just built for example (start a fresh `pwsh` instance first so you can unload the module with an `exit`; otherwise building again may fail because the `.dll` will be held open):\n\n```powershell\npwsh\nImport-Module ./module/Microsoft.PowerShell.ConsoleGuiTools\n```\n\nAnd then run the cmdlet you want to test, for example:\n\n```powershell\nGet-Process | Out-ConsoleGridView\nexit\n```\n\n\u003e NOTE: If you change the code and rebuild the project, you'll need to launch a\n\u003e _new_ PowerShell process since the DLL is already loaded and can't be unloaded.\n\n### 5. Debugging in Visual Studio Code\n\n```powershell\ncode ./ConsoleGuiTools\n```\n\nBuild by hitting `Ctrl-Shift-B` in VS Code.\n\nSet a breakpoint and hit `F5` to start the debugger.\n\nClick on the VS Code \"TERMINAL\" tab and type your command that starts `Out-ConsoleGridView`, e.g.\n\n```powershell\nls | ocgv\n```\n\nYour breakpoint should be hit.\n\n## Contributions Welcome\n\nWe would love to incorporate community contributions into this project.  If\nyou would like to contribute code, documentation, tests, or bug reports,\nplease read the [development section above](https://github.com/PowerShell/ConsoleGuiTools#development)\nto learn more.\n\n## Microsoft.PowerShell.ConsoleGuiTools Architecture\n\n`ConsoleGuiTools` consists of 2 .NET Projects:\n\n* ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView\n* OutGridView.Models - Contains data contracts between the GUI \u0026 Cmdlet\n\n_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).\n\n## Maintainers\n\n* [Andy Jordan](https://andyleejordan.com) - [@andyleejordan](https://github.com/andyleejordan)\n* [Tig Kindel](https://www.kindel.com) - [@tig](https://github.com/tig)\n\nOriginally authored by [Tyler Leonhardt](http://twitter.com/tylerleonhardt).\n\n## License\n\nThis project is [licensed under the MIT License](LICENSE.txt).\n\n## Code of Conduct\n\nPlease see our [Code of Conduct](.github/CODE_OF_CONDUCT.md) before participating in this project.\n\n## Security Policy\n\nFor any security issues, please see our [Security Policy](.github/SECURITY.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershell%2Fconsoleguitools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowershell%2Fconsoleguitools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershell%2Fconsoleguitools/lists"}