Skip to content

Commit 19d1139

Browse files
authored
Adds an OCGV Demo (#202)
* Added demo (for use with github.com/StartAutomating/ShowDemo) * Updated readme gif for ogcv * fixed typo in demo
1 parent 78ae125 commit 19d1139

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

demo.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .Silent cls
2+
# Out-ConsoleGridView (ocgv) from Microsoft.PowerShell.ConsoleGuiTools Demo - Press enter to move to next step in demo
3+
# Example 1: Output processes to a grid view
4+
Get-Process | Out-ConsoleGridView
5+
# .Silent cls
6+
# Example 2: Display a formatted table in a grid view
7+
Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView
8+
# .Silent cls
9+
# Example 3: Define the function 'killp' to kill a process
10+
function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} }
11+
killp
12+
# .Silent cls
13+
# Example 3b: 'killp note' fitlers for "note" (e.g. notepad.exe)
14+
killp note
15+
# .Silent cls
16+
# Example 4: Navigate PowerShell command history (Map this to F7 with https://github.com/gui-cs/F7History)
17+
Get-History | Sort-Object -Descending -Property Id -Unique | Select-Object CommandLine -ExpandProperty CommandLine | Out-ConsoleGridView -OutputMode Single -Filter $line -Title "Command Line History"
327 KB
Loading

0 commit comments

Comments
 (0)