Send output to an interactive table in a separate window.
Syntax
Out-GridView [-InputObject psobject] [-Title string] [CommonParameters]
Key
-InputObject psobject
Input object to be displayed
If a collection of objects are specified, Out-GridView will treat
the collection as one collection object, and will display one row
that represents the entire collection.
To display the each object in a collection, use a pipeline operator (|)
to send objects to Out-GridView.
-Title string
The text that appears in the title bar of the Out-GridView window.
By default, the title bar displays the command that invokes Out-GridView.
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.
If the current location is a registry key, then -filepath must either be specified as filesystem::yourfilename.txt or use a full path C:\docs\yourfile.txt
The final part of displaying PowerShell output is a hidden background call to an Output cmdlet, by default as the last part of the execution process PowerShell calls the default output cmdlet which is typically Out-Host.
Examples
Get the processes running on the local computer and sends them to a grid view window:
PS C:\> get-process | out-gridview
or
PS C:\> $p = get-process
PS C:\> $p | out-gridview
Display a formatted table in a grid view window:
PS C:\> get-process | select-object -property name, workingset, peakworkingset | sort-object -property workingset -de sc | out-gridview
“All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident” ~ Arthur Schopenhauer
Related:
Out-Default - Send output to default
Out-Host - Send the pipelined output to the host
Out-Null - Send output to null
Out-Printer - Send the output to a printer
Out-String - Send output to the pipleline as strings
Tee-Object - Send input objects to two places
Equivalent bash commands: redirection - Redirection and Process Substitution, cat > file2.txt – Redirect standard input into a file
© Copyright SS64.com 1999-2013
Some rights reserved