-
Notifications
You must be signed in to change notification settings - Fork 129
Cross-Platform-OutGridView #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
RFC: | ||
Author: John Zeiders | ||
Status: Draft | ||
SupercededBy: | ||
Version: 0.1 | ||
Area: Commands | ||
Comments Due: 6/25/2019 | ||
--- | ||
|
||
# Cross Platform Out-GridView | ||
|
||
Out-Gridview was a popular command in Windows PowerShell. | ||
Its dependence on Windows Presentation Foundation API's meant that it didn't make it into PowerShell Core. | ||
|
||
> The Out-GridView cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table. | ||
|
||
# Motivation | ||
|
||
The feature is a commonly cited reason for not migrating to Powershell Core and its implementation will help further adoption. | ||
|
||
# Specification | ||
|
||
## cmdlet | ||
|
||
The cmdlet will be a modern implementation of [Out-GridView](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-5.1) and also cross platform supported. | ||
|
||
```powershell | ||
Out-GridView | ||
[-InputObject <PSObject>] | ||
[-Title <String>] | ||
[-PassThru] | ||
[<CommonParameters>] | ||
|
||
Out-GridView | ||
[-InputObject <PSObject>] | ||
[-Title <String>] | ||
[-Wait] | ||
[<CommonParameters>] | ||
|
||
Out-GridView | ||
[-InputObject <PSObject>] | ||
[-Title <String>] | ||
[-OutputMode <OutputModeOption>] | ||
[<CommonParameters>] | ||
``` | ||
|
||
## GUI | ||
|
||
The GUI will be implemented on top of [Avalonia UI Framework](https://github.com/AvaloniaUI/Avalonia). | ||
The project was chosen for its active development, implemented capabilities, modeling of WPF, and cross platform support. | ||
|
||
A new feature `Show Script` will be added that will generate an equivalent PowerShell script that represents the filters manually applied to Out-GridView. | ||
The goal being to enable better automation at scale while also allowing graphical editing of filters. | ||
|
||
Wireframe of the new design. | ||
The wireframe is intended for visual reference, it is **not** a pixel perfect representation. | ||
The most important part to note is the new layout for filters as opposed to the original "Criteria Panel". | ||
|
||
 | ||
|
||
## Module | ||
|
||
Out-GridView will be added to the PowerShell Graphical Tools Module Microsoft.PowerShell.GraphicalTools. | ||
Forming the basis for future cross-platform graphical commands. | ||
|
||
## Removed Features | ||
|
||
* Search in Column - Better solved by filters | ||
|
||
# Alternative Proposals and Considerations | ||
|
||
## GUI Frameworks | ||
|
||
### Electron | ||
|
||
Despite it's popularity as a cross-platform framework, it's slow boot times make it the wrong choice for a command that is frequently used to create confirmation and selection prompts. | ||
|
||
### Web | ||
|
||
An interesting concept, particularly interesting for the ability to integrate directly into VSCode. | ||
However, the dependency on having a browser pre-installed makes it less than ideal. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment.
Certainly in the primary use-cases (core on Windows, core on Mac, core on WSL, core on Linux desktop) a browser will already exist. I find it unlikely that, in other cases where a graphical interface is needed, a browser won't exist.
I don't think it's reasonable to assume that Out-Gridview would be used in a nginx container. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's a fair point.
I will say...
Leveraging a web stack for a true
Out-GridView
that allows options like-PassThru
to work is a lot of extra work because it involves having to leverage a web server in order to send the results from the web back to the PowerShell process which is hosting a web server.I've personally looked into this, and it's a good chunk of work.
Leveraging a GUI framework that works nicely in process is much easier to manage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Przemyslaw did a great job with Out-HtmlView which is like
Out-GridView
but doesn't supportPassThru
- likely because he, like me, realized it's harder than first anticipated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have metrics?
I use Out-HtmlView daily. Perhaps because I am aware of its limits, I do not feel constrained by those limits.
How often are other use-cases actually necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we have metrics but getting feedback at conferences... they need
-PassThru
. Lots of folks use it as a filter for what happens next in the pipeline.example:
stop the processes you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-PassThru
is absolutely necessary. Many IT scripts use it as a way to interactively select objects to act against (like a list of computers or users, etc...).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was certainly not coming out "against"
-passthru
as a requirement.My point was (and is):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The point is, though, that getting data back from a browser instance on the command line in a format that is usable (much less even remotely similar to what was originally put in) would be a bit of a tall order, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording of the RFC should be updated to shift focus from the "not having a browser" problem to the
PassThru
problem.