955 sao GitHub và vẫn tăng — PowerShell/ConsoleGuiTools là dự án C# mà TopGit đang theo dõi trên nền tảng. Modules that mix PowerShell and GUIs/CUIs!
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
ConsoleGuiTools - Out-ConsoleGridView and Show-ObjectTree
[!IMPORTANT]
The PowerShell team has decided that Microsoft.PowerShell.ConsoleGuiTools is feature complete, so v0.7.7 is the last feature release.
@tig, the author of Terminal.Gui, is maintaining a community fork at tui-cs/PSTui. Users are encouraged to migrate to it going forward. We thank everyone for their contributions.
This repo contains the Out-ConsoleGridView
PowerShell Cmdlet providing console-based GUI experiences based on
Terminal.Gui (gui.cs).
Note: A module named Microsoft.PowerShell.GraphicalTools used to be built and published out of this repo, but per #101 it is deprecated and unmaintained until such time that it can be rewritten on top of .NET MAUI.
This command displays a formatted table in a grid view window.
It uses the Get-Process cmdlet to get the processes on the computer.
Then, it uses a pipeline operator (|) to send the process objects to the Select-Object cmdlet.
The command uses the Property parameter of Select-Object to select the Name, WorkingSet, and PeakWorkingSet properties to be displayed in the table.
Another pipeline operator sends the filtered objects to the Sort-Object cmdlet, which sorts them in descending order by the value of the WorkingSet property.
The final part of the command uses a pipeline operator (|) to send the formatted table to Out-ConsoleGridView.
You can now use the features of the grid view to search, sort, and filter the data.
Example 4: Save output to a variable, and then output a grid view
This command saves its output in a variable and sends it to Out-ConsoleGridView.
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 Out-ConsoleGridView.
The parentheses in the command establish the order of operations.
As a result, the output from the Get-ChildItem command is saved in the $A variable before it is sent to Out-ConsoleGridView.
Example 5: Output processes for a specified computer to a grid view
This command displays the processes that are running on the Server01 computer in a grid view window.
The command uses ocgv, which is the built-in alias for the Out-ConsoleGridView cmdlet, it uses the Title parameter to specify the window title.
Example 6: Define a function to kill processes using a graphical chooser
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.
Example 7: Use F7 as "Show Command History"
Add gui-cs/F7History to your Powershell profile.
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 was typed on the command line prior to hitting F7 or Shift-F7 will be used as a filter.
Example 8: Output processes to a tree view
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.
From 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):
And then run the cmdlet you want to test, for example:
Get-Process | Out-ConsoleGridView
exit
NOTE: If you change the code and rebuild the project, you'll need to launch a
new PowerShell process since the DLL is already loaded and can't be unloaded.
5. Debugging in Visual Studio Code
code ./ConsoleGuiTools
Build by hitting Ctrl-Shift-B in VS Code.
Set a breakpoint and hit F5 to start the debugger.
Click on the VS Code "TERMINAL" tab and type your command that starts Out-ConsoleGridView, e.g.
ls | ocgv
Your breakpoint should be hit.
Contributions Welcome
We would love to incorporate community contributions into this project. If
you would like to contribute code, documentation, tests, or bug reports,
please read the development section above
to learn more.
Microsoft.PowerShell.ConsoleGuiTools Architecture
ConsoleGuiTools consists of 2 .NET Projects:
ConsoleGuiTools - Cmdlet implementation for Out-ConsoleGridView
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).
Maintainers
Andy Jordan - @andyleejordan
Tig Kindel - @tig
Originally authored by Tyler Leonhardt.
License
This project is licensed under the MIT License.
Code of Conduct
Please see our Code of Conduct before participating in this project.
Security Policy
For any security issues, please see our Security Policy.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/PowerShell/ConsoleGuiTools là nguồn chính thức.
PowerShell/ConsoleGuiTools có bao nhiêu sao?
PowerShell/ConsoleGuiTools có 955 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/PowerShell/ConsoleGuiTools. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
PowerShell/ConsoleGuiTools có phải mã nguồn mở không?
Có — PowerShell/ConsoleGuiTools phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/PowerShell/ConsoleGuiTools.
PowerShell/ConsoleGuiTools còn đang phát triển không?
Commit gần nhất trên PowerShell/ConsoleGuiTools là 3 tháng trước (theo timestamp GitHub). Repo có 76 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
PowerShell/ConsoleGuiTools dùng license gì?
PowerShell/ConsoleGuiTools phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
PowerShell/ConsoleGuiTools là gì?
PowerShell/ConsoleGuiTools (PowerShell/ConsoleGuiTools) là dự án C# trên GitHub. Theo mô tả gốc: Modules that mix PowerShell and GUIs/CUIs!
PowerShell/ConsoleGuiTools viết bằng ngôn ngữ gì?
PowerShell/ConsoleGuiTools chủ yếu viết bằng C#. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
ConsoleGuiTools có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về ConsoleGuiTools.