Friday, November 09, 2007

PowerShell V2 New Feature - Out-Gridview

Out-GridView is new cmdlet in PowerShell V2 CTP. The cmdlet takes the output of the pipeline and opens a new window to present the data. This windows is a simple grid, with Columns that can be sorted.

For example,

get-process |select name,handlecount,vm,pm |out-gridview

This simple statement gets the processes, removes all but a few properties, and pipes that to out-grid-view. This creates a separate window, like this:


Some neat things - first each of the column headings can be clicked to re-sort the output based on that column. You can also type in some characters at the top to find a subset of the rows, like this, where I type "exp" and find all the processes whose name contains "exp":

This stuff rocks!!

No comments: