PowerShell / ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools
MIT License
794 stars 60 forks source link

Add -Filter switch to set initial filter #109

Closed tig closed 4 years ago

tig commented 4 years ago

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

TylerLeonhardt commented 4 years ago

This is in

tig commented 4 years ago

When will you publish 0.6.0?

TylerLeonhardt commented 4 years ago

image

TylerLeonhardt commented 4 years ago

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