PowerShell Logo Small

Out-GridView



This is the built-in help made by Microsoft for the command 'Out-GridView', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Sends output to an interactive table in a separate window.

SYNTAX


Out-GridView [-InputObject <psobject>] [-Title <string>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Out-GridView cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table. This featur
e requires Microsoft .NET Framework 3.5 with Service Pack 1.

You can use the following features of the table to examine your data:

-- Hide, Show, and Reorder Columns: To hide, show, or reorder a column, right-click a column header and then click "Select Columns."

-- Sort. To sort the data, click a column header. Click again to toggle from ascending to descending order.

-- Quick Filter. Use the "Filter" box at the top of the window to search the text in the table. You can search for text in a particular column, s
earch for literals, and search for multiple words.

-- Criteria Filter. Use the "Add criteria" drop-down menu to create rules to filter the data. This is very useful for very large data sets, such
as event logs.

-- Copy and paste. To copy rows of data from Out-GridView, press CTRL+C (copy). You can paste the data into any text or spreadsheet program.

For instructions for using these features, type "get-help out-gridview -full" and see "How to Use the Grid View Window Features" in the NOTES sec
tion.



<

RELATED LINKS


Online version: http://go.microsoft.com/fwlink/?LinkID=113364

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>get-process | out-gridview



Description
-----------
This command gets the processes running on the local computer and sends them to a grid view window.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>$p = get-process

C:\PS> $p | out-gridview



Description
-----------
This command also gets the processes running on the local computer and sends them to a grid view window.

The first command uses the Get-Process command to get the processes on the computer and then saves the process objects in the $p variable.

The second command uses a pipeline operator to send the $p variable to Out-GridView.








-------------------------- EXAMPLE 3 --------------------------

C:\PS>get-process | select-object -property name, workingset, peakworkingset | sort-object -property workingset -desc | out-gridview



Description
-----------
This command displays a formatted table in a grid view window.

It uses the Get-Process cmdlet to get the processes on the computer.

Then, it uses a pipeline operator (|) to send the process objects to the Select-Object cmdlet. The command uses the Property parameter of Select-
Object to select the Name, WorkingSet, and PeakWorkingSet properties to be displayed in the table.

Another pipeline operator sends the filtered objects to the Sort-Object cmdlet, which sorts them in descending order by the value of the WorkingS
et property.

The final part of the command uses a pipeline operator (|) to send the formatted table to Out-GridView.

You can now use the features of the grid view to search, sort, and filter the data.








-------------------------- EXAMPLE 4 --------------------------

C:\PS>($a = get-childitem -path $pshome -recurse) | out-gridview



Description
-----------
This command saves its output in a variable and sends it to Out-GridView.

The command uses the Get-ChildItem cmdlet to get the files in the Windows PowerShell installation directory and its subdirectories. The path to t
he installation directory is saved in the $pshome automatic variable.

The command uses the assignment operator (=) to save the output in the $a variable and the pipeline operator (|) to send the output to Out-GridVi
ew.
The parentheses in the command establish the order of operations. As a result, the output from the Get-ChildItem command is saved in the $a varia
ble before it is sent to Out-GridView.








-------------------------- EXAMPLE 5 --------------------------

C:\PS>get-process -computername Server01| ogv -title "Processes - Server01"



Description
-----------
This command displays the processes that are running on the Server01 computer in a grid view window.

The command uses "ogv," which is the built-in alias for the Out-GridView cmdlet, it uses the Title parameter to specify the window title.








-------------------------- EXAMPLE 6 --------------------------

C:\PS>invoke-command -ComputerName S1, S2, S3 -scriptblock {get-culture} | out-gridview



Description
-----------
This example shows the correct format for sending data collected from remote computers to the Out-GridView cmdlet.

The command uses the Invoke-Command cmdlet to run a Get-Culture command on three remote computers. It uses a pipeline operator to send the data t
hat is returned to the Out-GridView cmdlet.

Notice that the script block that contains the commands that are run remotely does not include the Out-GridView command. If it did, the command w
ould fail when it tried to open a grid view window on each of the remote computers.