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

Add -Filter switch to set initial filter #109

Closed
tig opened this issue Sep 27, 2020 · 4 comments
Closed

Add -Filter switch to set initial filter #109

tig opened this issue Sep 27, 2020 · 4 comments

Comments

@tig
Copy link
Collaborator

tig commented Sep 27, 2020

In the latest variant of the "F7 for History" script @SteveL-MSFT used Select-Object -like to filter the history based on what was already on the command line.

I think this would be much slicker if we could pass an initial text to the cmdlet to use as a filter. E.g.

ls | ocgv -Filter "foo"

Then the script could change to:

...
    $history = Get-History | Sort-Object -Descending -Property Id | Select-Object CommandLine
    $selection = $history | Out-ConsoleGridView -Title "Select CommandLine from History" -OutputMode Single -Filter $line
...

Full script here: https://gist.github.com/tig/cbbeab7f53efd73e329afd6d4b838191

@tig tig mentioned this issue Sep 27, 2020
@TylerLeonhardt
Copy link
Member

This is in

@tig
Copy link
Collaborator Author

tig commented Sep 28, 2020

When will you publish 0.6.0?

@TylerLeonhardt
Copy link
Member

image

@TylerLeonhardt
Copy link
Member

https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools/0.6.0

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

No branches or pull requests

2 participants