Skip to content
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

Feature Request - Out-GridView, define/pass "default" filters through Parameters #78

Open
PsychoData opened this issue Mar 31, 2020 · 0 comments

Comments

@PsychoData
Copy link

@PsychoData PsychoData commented Mar 31, 2020

Migrated from PowerShell/PowerShell#12228

Add parameters to enable you to pass default filters to Out-GridView windows for when they are first shown.

For example, if I was writing a process to look for processes of some sort, and I wanted to show a simple GUI to say which process to kill.

I could show them a list of all processes, but it would be a nice feature if I could show them just a list of processes under their username/login session, predefined as a Criteria Filter

Proposed technical implementation details (optional)

With the current/old way I could filter it before I push it to Out-GridView, but if they wanted to find a process from another user, it wouldn't work or would have to be handled more completely in code.

The result would let you filter further, but not go backwards.
image

Where, if there was an option to pre-fill the form, we could show it to the user with Quick Search predefined like this
image

or, even better, pre-define the Criteria directly so that they could still easily use the quick search
image

If we could add a -DefaultFilter and/or -Criteria option, that might be sufficient.
Perhaps it could even support the same FilterScript as Where-Object?
If there was a way we could just pass Get-Process -IncludeUsername | Out-GridView -FilterScript {$_.Username -like "*Administrator"} and it predefined the Criteria from that, ending up looking like my final screenshot, I think that would be my Ideal implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.