outgridview
PowerShell: Use Out-GridView To Select Value for Variable
Summary: How to use the Out-GridView powershell commandlet to select a Value for a Variable.
Date: Around 2020
Refactor: 8 March 2025: Checked links and formatting.
Out-GridView allows you to interact with the output from a get commandlet. For example, say you want to select a server from Active Directory and put it in a variable but you can't quite remember the name.
Use the following command to display all AD computers, allowing you to select a server to put it in the variable:
$server = Get-ADComputer -Filter * | Out-GridView -PassThru -Title "Select server:"
Note the importance of the passthru option. If you don't set it, there won't be an option to actually select the server you need, it will just display all the AD computers.
outgridview.txt · Last modified: by 127.0.0.1