Powershell - out-gridview - highlight entry in display RRS feed

  • Question

  • When out-gridview is used, it displays a nice little table for selection with the first item already highlighted ( selected ). Is it possible to pre-select one or more entries before the grid is displayed? For example, I know that a list of items will be presented to the user ( using -passthru ) for user input. Let's say that I know there will be 15 items displayed, and from my scripting, I want to suggest to the user that they select the fifth and seventh items. Is there a way to have out-gridview pre-select the 5th and 7th lines  instead of the first line?


    Tuesday, December 15, 2015 6:03 PM


  • I highly doubt that functionality exists, but you can start by reading Get-Help Out-GridView -ShowWindow. There's a few improvements that Out-GridView can use. I hope to see some in the future... like, how about we have a way to fully expand certain columns, right? I doubt you'll get what you want today, but good luck. You can edit the title, so perhaps that's a way to send a message to the user...?
    • Edited by tommymaynard Tuesday, December 15, 2015 6:57 PM
    • Marked as answer by Bill_Stewart Tuesday, January 12, 2016 9:33 PM
    Tuesday, December 15, 2015 6:54 PM