Is there a plugin or tool that will let me display a list of objects to a user (Format-Table
style) and allow them to use the cursor to select a choice from the list, including potentially scrolling a long list? I would like to be able to do something like this:
Get-User -anr $search |
Get-Choice
| Set-User -EnableAccount true
This script should display a list of matching accounts at a console prompt, allow the user to scroll up and down the list interactively, and select a choice by pressing Enter (or pass null if the user hits escape). Only one account would be passed to Set-User, rather than a list of all matching choices.
Obviously details could differ. While I would prefer a console version, a graphical one would be acceptable (that popped up a Windows dialog). The exact keystrokes could be different. But the core goal (accepting a list, getting user input, piping out the result) should be met.
in v3:
Get-User -anr $search | Out-GridView -PassThru | Set-User -EnableAccount true
Take a look to Out-Form
pseudo use:
out-form -title "Enable Account" -data (Get-user -anr $search) -columnNames ("AccountName") `
-columnProperties ("SamAccountName") -actions @{Enable It!" = { $_ | Set-User -EnableAccount true}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With