Code Monkey home page Code Monkey logo

graphicaltools's Introduction

GraphicalTools

The GraphicalTools repo contains Microsoft.PowerShell.ConsoleGuiTools: a module that provides console-based GUI experiences based on Terminal.Gui (gui.cs).

Note that 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.

Installation

Install-Module Microsoft.PowerShell.ConsoleGuiTools

Features

Cross-platform! Use the cmdlet Out-ConsoleGridview to view and filter objects graphically.

screenshot of Out-ConsoleGridView

Development

1. Install PowerShell 7.1+

Install PowerShell 7.1+ with these instructions.

2. Clone the GitHub repository

git clone https://github.com/PowerShell/GraphicalTools.git

3. Install Invoke-Build

Install-Module InvokeBuild -Scope CurrentUser

Now you're ready to build the code. You can do so in one of two ways:

4. Building the code from PowerShell

PS ./GraphicalTools> Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools

From there you can import the module that you just built for example:

Import-Module ./module/Microsoft.PowerShell.ConsoleGuiTools

And then run the cmdlet you want to test, for example:

Get-Process | Out-ConsoleGridView

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

PS ./GraphicalTools> code .

Build by hitting Ctrl-Shift-B in VS Code.

To debug:

In a PowerShell session in the ./GraphicalTools directory, run pwsh (thus nesting PowerShell).

Then do the folowing:

Import-Module ./module/Microsoft.PowerShell.ConsoleGuiTools
$pid

This will import the latest built DLL and output the process ID you'll need for debugging. Copy this ID to the clipboard.

In VScode, set your breakpoints, etc. Then hit F5. In the VScode search box, paste the value printed by $pid. You'll see something like pwsh.exe 18328. Click that and the debug session will start.

In the PowerShell session run your commands; breakpoints will be hit, etc.

When done, run exit to exit the nested PowerShell and run pwsh again. This unloads the DLL. Repeat.

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.

(Deprecated) Microsoft.PowerShell.GraphicalTools Architecture

Due to the quirks of the PowerShell threading implementation, the design of GUIs in this application are non-standard. The cmdlet invokes an Avalonia application as a separate process to guarantee the GUI is running on the main thread. Graphical tools therefore consists of 3 .NET Projects.

  • Microsoft.PowerShell.GraphicalTools - Cmdlet implementations
  • OutGridView.Gui - Implementation of the Out-GridView window
  • OutGridView.Models - Contains data contracts between the GUI & Cmdlet

Maintainers

Originally authored by Tyler Leonhardt.

License

This project is licensed under the MIT License.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

graphicaltools's People

Contributors

tylerleonhardt avatar tig avatar stevel-msft avatar jzeiders avatar andyleejordan avatar corbob avatar adamdriscoll avatar bergmeister avatar davidpendraykalibrate avatar dependabot[bot] avatar lahell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.