Powershell Interactive Listing

Is there a plugin or tool that will allow me to display a list of objects for the user (style Format-Table) and allow them to use the cursor to select a choice from the list, including the potential scrolling of 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 in a console prompt, allowing the user to browse up and down the list interactively and select a choice by pressing Enter (or pass null if the user hit). Only one account will be transferred to Set-User, not a list of all suitable options.

Obviously, the details may vary. Although I would prefer the console version, the graphical option would be acceptable (this caused the Windows dialog). Exact keystrokes may vary. But the main goal (acceptance of the list, obtaining user input, output from the result) must be fulfilled.

+5
source share
2 answers

in v3 :

Get-User -anr $search | Out-GridView -PassThru | Set-User -EnableAccount true
+7
source

Take a look at 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}}
+1
source

All Articles