Out-GridView – OGV
November 20, 2009
Posted by on
This is one of the neatest cmdlets I’ve found. It is a great way to output lists very easily so you can filter, sort, and copy the contents to your clipboard. The cmdlet is Out-GridView and has an alias of ogv.
dir |ogvget-Process |ogv
Here’s what the output for get-process looks like in ogv:
- The filter box gives you a quick way to find text within all of the fields
- Criteria gives you a way to filter on specific columns and use logic like greater than or contains
- The columns are sortable by a single click
- If you right click on the columns you can hide columns
- The columns can be reordered by dragging a column left or right
- You can select all or individual rows and copy and paste the contents into a text editor or excel
In addition you can use select-Object to immediately filter and order columns before it gets into the GridView:
dir |select-Object Name, LastWriteTime |ogv
As you can see this is a powerful and useful little cmdlet that should definitely remain in your Powershell utility belt.