PowerShell / ConsoleGuiTools

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

Please add the ability to have "Default" selections when using Multiple OutputMode #212

Open lexiismadd opened 11 months ago

lexiismadd commented 11 months ago

Summary of the new feature / enhancement

Please add the ability to add "default" selections when using the Multiple OutputMode. By adding this, we could present the end user with the Gridview with already pre-selected options which they can then choose to deselect and/or select additional options from what are shown

Proposed technical implementation details (optional)

No response

tig commented 11 months ago

Could you provide an example invocation so I can better understand?

E.g.:

ls | ocgv -OutputMode Multiple Select @{ Index = 1; Index = 3 } would select the 1st and 3rd file.

ls | ocgv -Select @{ Name = ".gitconfig" } would select the first file named ".gitconfig".

lexiismadd commented 11 months ago

Actually, both of those examples would work great. Also perhaps where an array of PSCustomObjects are passed to ocgv, passing another array with the PSCustomObjects that you want pre-selected in the list. But those two options you presented would be great!