diff --git a/demo.ps1 b/demo.ps1 new file mode 100644 index 0000000..4875889 --- /dev/null +++ b/demo.ps1 @@ -0,0 +1,17 @@ +# .Silent cls +# Out-ConsoleGridView (ocgv) from Microsoft.PowerShell.ConsoleGuiTools Demo - Press enter to move to next step in demo +# Example 1: Output processes to a grid view +Get-Process | Out-ConsoleGridView +# .Silent cls +# Example 2: Display a formatted table in a grid view +Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-ConsoleGridView +# .Silent cls +# Example 3: Define the function 'killp' to kill a process +function killp { Get-Process | Out-ConsoleGridView -OutputMode Single -Filter $args[0] | Stop-Process -Id {$_.Id} } +killp +# .Silent cls +# Example 3b: 'killp note' fitlers for "note" (e.g. notepad.exe) +killp note +# .Silent cls +# Example 4: Navigate PowerShell command history (Map this to F7 with https://github.com/gui-cs/F7History) +Get-History | Sort-Object -Descending -Property Id -Unique | Select-Object CommandLine -ExpandProperty CommandLine | Out-ConsoleGridView -OutputMode Single -Filter $line -Title "Command Line History" \ No newline at end of file diff --git a/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif b/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif index fe2590e..d70139a 100644 Binary files a/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif and b/docs/Microsoft.PowerShell.ConsoleGuiTools/ocgv.gif differ