You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Microsoft.PowerShell.ConsoleGuiTools/Out-ConsoleGridView.md
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,7 @@ Sends output to an interactive table in the same console window.
25
25
26
26
The **Out-ConsoleGridView** cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table.
27
27
28
-
You can use the following features of the table to examine your data:
29
-
30
-
- 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, search for literals, and search for multiple words. You can use the `-Filter` command to pre-populate the Filter box. The filter uses regular expressions.
28
+
Use the Filter box at the top of the window to search the text in the table. Search for text in a particular column, search for literals, and search for multiple words. Use the `-Filter` parameter to pre-populate the Filter box. The filter uses regular expressions.
31
29
32
30
For instructions for using these features, type `Get-Help Out-ConsoleGridView -Full` and see How to Use the Grid View Window Features in the Notes section.
33
31
@@ -38,16 +36,16 @@ To send items from the interactive window down the pipeline, click to select the
38
36
### Example 1: Output processes to a grid view
39
37
40
38
```PowerShell
41
-
PS C:\> Get-Process | Out-ConsoleGridView
39
+
Get-Process | Out-ConsoleGridView
42
40
```
43
41
44
42
This command gets the processes running on the local computer and sends them to a grid view window.
45
43
46
44
### Example 2: Use a variable to output processes to a grid view
47
45
48
46
```PowerShell
49
-
PS C:\> $P = Get-Process
50
-
PS C:\> $P | Out-ConsoleGridView -OutputMode Single
47
+
$P = Get-Process
48
+
$P | Out-ConsoleGridView -OutputMode Single
51
49
```
52
50
53
51
This command also gets the processes running on the local computer and sends them to a grid view window.
@@ -61,7 +59,7 @@ By specifying `-OutputMode Single` the grid view window will be restricted to a
61
59
### Example 3: Display a formatted table in a grid view
This command displays the processes that are running on the Server01 computer in a grid view window.
@@ -106,17 +104,17 @@ The command uses `ocgv`, which is the built-in alias for the **Out-ConsoleGridVi
106
104
### Example 6: Define a function to kill processes using a graphical chooser
107
105
108
106
```PowerShell
109
-
PS C:\> function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
110
-
PS C:\> killp note
107
+
function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
108
+
killp note
111
109
```
112
110
This example shows defining a function named `killp` that shows a grid view of all running processes and allows the user to select one to kill it.
113
111
114
-
The example uses the `-Filter`paramter to filter for all proceses with a name that includes `note` (thus highlighting `Notepad` if it were running. Selecting an item in the grid view and pressing `ENTER` will kill that process.
112
+
The example uses the `-Filter`parameter to filter for all proceses with a name that includes `note` (thus highlighting `Notepad` if it were running. Selecting an item in the grid view and pressing `ENTER` will kill that process.
115
113
116
114
### Example 7: Pass multiple items through Out-ConsoleGridView
The **Show-ObjectTree** cmdlet sends the output from a command to a tree view window where the output is displayed in an interactive tree.
26
26
27
-
You can use the following features of the tree to examine your data:
28
-
29
-
- Quick Filter. Use the Filter box at the top of the window to search the text in the tree. You can search for literals or multiple words. You can use the `-Filter` command to pre-populate the Filter box. The filter uses regular expressions.
27
+
Use the Filter box at the top of the window to search the text in the tree including literals or multiple words. Use the `-Filter` parameter to pre-populate the Filter box. The filter uses regular expressions.
30
28
31
29
For instructions for using these features, type `Get-Help Show-ObjectTree -Full` and see How to Use the Tree View Window Features in the Notes section.
32
30
@@ -35,20 +33,21 @@ For instructions for using these features, type `Get-Help Show-ObjectTree -Full`
35
33
### Example 1: Output processes to a tree view
36
34
37
35
```PowerShell
38
-
PS C:\> Get-Process | Show-ObjectTree
36
+
Get-Process | Show-ObjectTree
39
37
```
40
38
41
39
This command gets the processes running on the local computer and sends them to a tree view window.
42
40
43
41
### Example 2: Save output to a variable, and then output a tree view
This command saves its output in a variable and sends it to **Show-ObjectTree**.
50
48
51
49
The command uses the Get-ChildItem cmdlet to get the files in the Windows PowerShell installation directory and its subdirectories.
50
+
52
51
The path to the installation directory is saved in the $pshome automatic variable.
53
52
54
53
The command uses the assignment operator (=) to save the output in the $A variable and the pipeline operator (|) to send the output to **Show-ObjectTree**.
Specifies that the cmdlet accepts input for **Show-ObjectTree**.
78
77
79
-
When you use the **InputObject** parameter to send a collection of objects to **Show-ObjectTree**, **Show-ObjectTree** treats the collection as one collection object, and it displays one row that represents the collection.
78
+
The **InputObject** parameter enables sending a collection of objects to **Show-ObjectTree**, **Show-ObjectTree** treats the collection as one collection object, and it displays one row that represents the collection.
80
79
81
80
To display the each object in the collection, use a pipeline operator (|) to send objects to **Show-ObjectTree**.
82
81
@@ -141,7 +140,7 @@ You can send any object to this cmdlet.
141
140
142
141
## NOTES
143
142
144
-
* The command output that you send to **Show-ObjectTree** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
143
+
* The command output sent to **Show-ObjectTree** should not be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet.
145
144
146
145
* Deserialized output from remote commands might not be formatted correctly in the tree view window.
0 commit comments