Out-GridView
Browse and filter results in a window
Get-Process | Out-GridView
- Works on
- Windows
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Out-GridView
- PowerShell 7 Built in on Windows. On Linux and macOS, install the Microsoft.PowerShell.ConsoleGuiTools module and use Out-ConsoleGridView instead.
Opens a window with your results as a table. Click a column to sort, or type in the filter box. Nothing in the pipeline is changed.
Pick rows and keep going
With -PassThru, the rows you select and confirm with OK continue down the pipeline. That turns it into a simple picker:
Get-Service | Where-Object Status -eq 'Running' | Out-GridView -PassThru | Restart-Service -WhatIf
-Title sets the window title. -OutputMode Single allows only one choice.
Try this
Get-ChildItem -Path .\docs -Recurse -File | Select-Object Name, Length, LastWriteTime | Out-GridView -Title 'Files in docs'