@@ -25,16 +25,16 @@ to view and filter objects graphically.
2525### Example 1: Output processes to a grid view
2626
2727``` PowerShell
28- PS C:\> Get-Process | Out-ConsoleGridView
28+ Get-Process | Out-ConsoleGridView
2929```
3030
3131This command gets the processes running on the local computer and sends them to a grid view window.
3232
3333### Example 2: Use a variable to output processes to a grid view
3434
3535``` PowerShell
36- PS C:\> $P = Get-Process
37- PS C:\> $P | Out-ConsoleGridView -OutputMode Single
36+ $P = Get-Process
37+ $P | Out-ConsoleGridView -OutputMode Single
3838```
3939
4040This command also gets the processes running on the local computer and sends them to a grid view window.
@@ -48,7 +48,7 @@ By specifying `-OutputMode Single` the grid view window will be restricted to a
4848### Example 3: Display a formatted table in a grid view
4949
5050``` PowerShell
51- PS C:\> Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView
51+ Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView
5252```
5353
5454This command displays a formatted table in a grid view window.
@@ -67,7 +67,7 @@ You can now use the features of the grid view to search, sort, and filter the da
6767### Example 4: Save output to a variable, and then output a grid view
6868
6969``` PowerShell
70- PS C:\> ($A = Get-ChildItem -Path $pshome -Recurse) | Out-ConsoleGridView
70+ ($A = Get-ChildItem -Path $pshome -Recurse) | Out-ConsoleGridView
7171```
7272
7373This command saves its output in a variable and sends it to ** Out-ConsoleGridView** .
@@ -83,7 +83,7 @@ As a result, the output from the Get-ChildItem command is saved in the $A variab
8383### Example 5: Output processes for a specified computer to a grid view
8484
8585``` PowerShell
86- PS C:\> Get-Process -ComputerName "Server01" | ocgv -Title "Processes - Server01"
86+ Get-Process -ComputerName "Server01" | ocgv -Title "Processes - Server01"
8787```
8888
8989This command displays the processes that are running on the Server01 computer in a grid view window.
@@ -93,8 +93,8 @@ The command uses `ocgv`, which is the built-in alias for the **Out-ConsoleGridVi
9393### Example 6: Define a function to kill processes using a graphical chooser
9494
9595``` PowerShell
96- PS C:\> function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
97- PS C:\> killp note
96+ function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
97+ killp note
9898```
9999This 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.
100100
@@ -103,7 +103,7 @@ The example uses the `-Filter` paramter to filter for all proceses with a name t
103103### Example 7: Pass multiple items through Out-ConsoleGridView
104104
105105``` PowerShell
106- PS C:\> Get-Process | Out-ConsoleGridView -PassThru | Export-Csv -Path .\ProcessLog.csv
106+ Get-Process | Out-ConsoleGridView -PassThru | Export-Csv -Path .\ProcessLog.csv
107107```
108108
109109This command lets you select multiple processes from the ** Out-ConsoleGridView** window.
@@ -147,7 +147,9 @@ Now you're ready to build the code. You can do so in one of two ways:
147147### 4. Building the code from PowerShell
148148
149149``` powershell
150- PS ./GraphicalTools> Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools
150+ pushd ./GraphicalTools
151+ Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools
152+ popd
151153```
152154
153155From there you can import the module that you just built for example (start a fresh ` pwsh ` instance first so you can unload the module with an ` exit ` ; otherwise building again may fail because the ` .dll ` will be held open):
170172### 5. Debugging in Visual Studio Code
171173
172174``` powershell
173- PS ./GraphicalTools> code .
175+ code ./GraphicalTools
174176```
175177
176178Build by hitting ` Ctrl-Shift-B ` in VS Code.
0 commit comments