Skip to content

Commit b5a4bcd

Browse files
authored
Update README.md to remove prompts that aren't part of the exapmle commands. (#215)
Removes example prompts `PS C:\> ` from command examples so that commands can be executed as copied.
1 parent a79e23c commit b5a4bcd

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3131
This 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

4040
This 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

5454
This 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

7373
This 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

8989
This 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
```
9999
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.
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

109109
This 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

153155
From 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):
@@ -170,7 +172,7 @@ exit
170172
### 5. Debugging in Visual Studio Code
171173

172174
```powershell
173-
PS ./GraphicalTools> code .
175+
code ./GraphicalTools
174176
```
175177

176178
Build by hitting `Ctrl-Shift-B` in VS Code.

0 commit comments

Comments
 (0)