Welcome to MSDN Blogs Sign in | Join | Help

out-gridview

One of the new feature areas for PowerShell V2 CTP is support for rich output.  The out-gridview cmdlet allows you to send the output of any PowerShell command into a fully interactive grid window.  This feature is available from standard PowerShell and Graphical PowerShell.  Out-GridView can be very useful if the output of your command is long or you need to perform a deeper analysis on that data. 

Here is an example of how to use the out-gridview to display the running processes.  Out-GridView also supports the following aliases grid and ogv

clip_image002[4]

After issuing the command, a new window will appear that contains a grid that has been populated with the data from the pipeline.  This window is separate from the main PowerShell window.  You can go back to PowerShell and issue different commands or even create new grid windows.  However, if you close PowerShell – then all grid windows will also be closed.

The search feature makes it easy to quickly find a specific piece of data.  Here are a few details on how the search mechanism works:

· Searches across all columns and rows

· Search on a single column with this syntax <columnName>:searchValue  

· Matching is not case-sensitive

· Search will match any part of a value

· If the search text is enclosed in quotes – the search should only find items that have the exact phrase.

· May search on more than 1 word –search should treat it like there is a AND between the words.  In other words – it should find rows that have word a AND word b

· Special characters like punctuation, semi-colons, colons, brackets, less than, greater than, brackets, braces are NOT ignored. 

The following example demonstrates searching the application log for entries containing “SQL”.  Any entries that don’t contain that text are no longer in the list.  To get the grid to display all of the entries again erase the text in the search area.

clip_image004[6]

The grid allows sorting by any column –clicking on the column header for a column then the grid will be sorted by that column in ascending order.  Clicking again on the same column then the sort direction will be reversed (descending). 

clip_image006[4]

Grouping is a useful technique to better help visually organize your data.  To turn grouping on right-click anywhere in the column headers and select “Show in Groups” to toggle that feature on.   When you click on one of the column headers the grid will group by that column.  The following example demonstrates grouping a list of services by the status column.  The items under each grouping may be hidden or shown by selecting the arrow next to each grouping.  All  groupings are expanded (shown) by default.  It is also possible to reverse the sort direction of the groups by clicking the column in the header.

clip_image008[4]

Please send feedback to gPSfeedback@microsoft.com

Thanks,

Brent Taft [MSFT]

Senior Program Manager

Published Monday, December 17, 2007 9:03 PM by PowerShellTeam

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: out-gridview

"One of the new feature areas for PowerShell V2 CTP is support for rich output."

Great way to make composable functionality combining the power of a command line with the usability of a GUI.  NICE!

Monday, December 17, 2007 9:10 PM by Mike Schinkel

# re: out-gridview

I remember one of the concerns with having plural/singular forms of names in PowerShell was that the ambiguity might make it harder to memorize commands in environments where IntelliSense-ish features couldn't be implemented, for instance in command-line only OS'.

Has that concern been forgotten?

Tuesday, December 18, 2007 3:42 AM by reinux

# re: out-gridview

I see no plural commands shown. Are you referring to gps? It's an alias for the Get-Process cmdlet.

Tuesday, December 18, 2007 2:45 PM by n4cer

# Windows PowerShell Help - Live on TechNet

Updated Windows PowerShell Help topics are now live in the TechNet library at http://technet.microsoft.com/en-us/library/bb978526.aspx

Tuesday, December 18, 2007 4:08 PM by Windows PowerShell

# re: out-gridview

Now PowerShell is the tool I have been looking for years... Fantastic work guys!!!

Friday, December 21, 2007 5:05 PM by Tom W

# re: out-gridview

Actually I'm referring to the reasoning for the lack of plurals: http://blogs.msdn.com/powershell/archive/2006/07/23/Issues-with-Windows-PowerShell-syntax.aspx

Wednesday, January 02, 2008 10:13 PM by reinux

# re: out-gridview

Why don't you just make PowerShell itself into a graphical command line? Just because it's a command line doesn't mean it can't contain graphics.

Instead of putting the table in a separate window, put it on the main window, replacing the traditional text-based table. And allow the user to type in a proportional font. In the future you could even allow grid cells to contain custom fonts or graphics. Think about it.

Wednesday, March 19, 2008 12:28 PM by David Piepgrass

# [PL] Powershell v2.0 wspiera WPF oraz inne odkrycia

Tak się dalej bawię nowym Powershellem i dokonuję kolejnych odkryć. W nocy wspomniałem, że Windows Powershell

Sunday, April 13, 2008 12:24 PM by Only Human | Devoted to technology v.2.0

# re: out-gridview

I've been doing a lot with out-gridview lately. It seems that memory consumption in the powershell.exe process goes up each time out-gridview executes, and I haven't found a way to free this memory.  Anyone else experience this, or know of a way to release the memory?  I've tried using [GC]::Collect(), but didn't seem to make an difference.

Sunday, September 07, 2008 1:33 AM by cognitivecarbon

# out-gridview

PowerShell is hosted in our .NET smart client app. Is there a way to embed the Out-GridView's popup control in our WinForm?

Wednesday, October 22, 2008 1:29 PM by frank1461

# re: out-gridview

Is there a way to remove the limit on the number of columns displayed with out-gridview?

Wednesday, November 12, 2008 5:40 PM by Joel

# re: out-gridview

Is there a way to wordwrap the contents in a column?

Seems to me out-gridview is complete other than that (v2ctp3) - if its not currently possible, hopefully this can be added as a feature request for the next release    ;-)

Tuesday, February 10, 2009 11:15 PM by Simon Savva

# Out-GridView Revisited

It has been more than one year since we updated Out-GridView feature with you. In case you are not familiar

Wednesday, March 11, 2009 7:10 PM by Windows PowerShell Blog

# re: out-gridview

Can you save the output to reopen the grid?  Also can you copy the data to paste into Excel?

Thanks!

Wednesday, August 12, 2009 10:39 AM by Patrick

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker