PowerShell Out-GridView: Interactive Data Explorer

Letting a non-technical user filter a 1,000-row dataset without writing them a custom form takes one cmdlet: PowerShell Out-GridView. It opens a GUI table with built-in sorting, filtering, and row selection — no WinForms code, no parameters to explain. The -PassThru switch turns it into an interactive picker that returns selected rows back into the pipeline for further processing.
Quick Answer / TL;DR
Pipe any objects to Out-GridView to display them in a sortable, filterable GUI table. Add -PassThru to let the user select rows and return them to the pipeline. Not available on Linux or macOS.
Basic Out-GridView Display
Out-GridView opens a window showing all objects in a table. Users can type in the filter box to search across all columns, click column headers to sort, and resize columns. The PowerShell session blocks until the user closes the window. By default, no data is returned to the pipeline — it is a display-only endpoint.
# Display all running processes in a grid
Get-Process | Out-GridView
# Show services in a filtered grid
Get-Service | Select-Object Name, DisplayName, Status, StartType | Out-GridView
# Show AD users
Get-ADUser -Filter * -Properties Department, Mail |
Select-Object Name, SamAccountName, Department, Mail, Enabled |
Out-GridView
-Title for Window Title
The -Title parameter sets the window title bar text, giving users context about what they are looking at. This is especially important when Out-GridView is used in a script where users may not know what data is being shown.
# Custom window title
Get-ChildItem C:\Logs -Filter *.log |
Select-Object Name, Length, LastWriteTime |
Out-GridView -Title 'Log Files in C:\Logs — Double-click a row to select'
Get-ADUser -Filter {Enabled -eq $true} |
Out-GridView -Title 'Active Directory Users'
-PassThru to Select and Return
With -PassThru, the grid view window gains OK and Cancel buttons. The user selects one or more rows (with Ctrl/Shift for multi-select), clicks OK, and the selected objects flow back into the pipeline. This pattern is powerful for building interactive scripts that operate on user-selected items.
# Let user select a computer from a list, then run a command on it
$selected = Get-ADComputer -Filter * |
Select-Object Name, OperatingSystem, LastLogonDate |
Out-GridView -Title 'Select target computer' -PassThru -OutputMode Single
if ($selected) {
Invoke-Command -ComputerName $selected.Name -ScriptBlock {
Get-Service | Where-Object Status -ne Running
}
}
Interactive Process Killer Pattern
A classic Out-GridView use case: browse running processes visually, select the ones to kill, and pipe directly to Stop-Process. This replaces the need for a custom WinForms application for an operator-friendly process management tool.
# Interactive process killer — select processes to stop
Get-Process |
Select-Object Name, Id,
@{N='CPU (s)'; E={[math]::Round($_.CPU, 1)}},
@{N='RAM (MB)'; E={[math]::Round($_.WorkingSet / 1MB, 1)}} |
Sort-Object 'CPU (s)' -Descending |
Out-GridView -Title 'Select processes to stop (Ctrl+Click for multi-select)' -PassThru |
ForEach-Object {
Stop-Process -Id $_.Id -Force
Write-Host "Stopped: $($_.Name) (PID $($_.Id))"
}
Use as File/Item Picker
Out-GridView works with any collection, including file lists. Use it as a visual file picker when you need a user to select one file from a directory without building a full OpenFileDialog.
# Visual file picker
$selectedScript = Get-ChildItem C:\Scripts -Filter *.ps1 -Recurse |
Select-Object Name, Directory, LastWriteTime,
@{N='Size (KB)'; E={[math]::Round($_.Length/1KB,1)}} |
Out-GridView -Title 'Select a script to run' -PassThru -OutputMode Single
if ($selectedScript) {
$fullPath = Join-Path $selectedScript.Directory $selectedScript.Name
Write-Host "Selected: $fullPath"
# . $fullPath to dot-source and run
}
Limitations: GUI Only, No PowerShell 7 on Linux
Out-GridView requires Windows and the .NET Windows Forms or WPF stack. It is available in Windows PowerShell 5.1 on all Windows versions and in PowerShell 7 on Windows (requires the Microsoft.PowerShell.GraphicalTools module installed separately). It is not available in PowerShell on Linux or macOS. Use Format-Table as a fallback on non-Windows systems.
# Cross-platform guard
if ($IsWindows -and $PSVersionTable.PSVersion.Major -ge 5) {
Get-Process | Out-GridView -Title 'Processes'
} else {
Get-Process | Format-Table Name, Id, CPU -AutoSize
}
# Install GraphicalTools for PowerShell 7 on Windows
Install-Module Microsoft.PowerShell.GraphicalTools -Scope CurrentUser
Common Errors and Fixes
- Not available in PowerShell Core on Linux/Mac. Running
Out-GridViewon Linux raises “The command Out-GridView is not supported on this platform.” UseFormat-Table | Out-Hostas a console fallback, or installMicrosoft.PowerShell.GraphicalToolswhich provides a cross-platform grid view (on supported platforms). - -PassThru with -OutputMode Single vs Multiple.
-OutputMode Singleonly lets the user select one row (single-click, no multi-select).-OutputMode Multipleallows multi-row selection with Ctrl/Shift. The plain-PassThru(without-OutputMode) behaves likeMultiple. Use-OutputMode Singlewhen your script expects exactly one selected item.
Related Cmdlets / See Also
Wrapping Up
Out-GridView is one of PowerShell’s most user-friendly tools for interactive data exploration and selection. Use it for operator-driven scripts that need visual filtering and selection without building a full GUI. Remember -PassThru for interactive selection workflows, -OutputMode Single when only one selection is valid, and test your cross-platform fallback for non-Windows environments.


