Commands / Text and objects

Out-GridView

Browse and filter results in a window

beginner Text and objects Aliases ogv

Out-GridView
 Get-Process | Out-GridView
Works on
Windows
PowerShell
5.1 and later
Reference
Microsoft Learn: Out-GridView

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'

Related commands