Skip to content

Commit

Permalink
tip: Add tip for Out-ConsoleGridView
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlydog committed Oct 20, 2023
1 parent 09c1e08 commit 9b349dc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$tip = [tiPS.PowerShellTip]::new()
$tip.CreatedDate = [DateTime]::Parse('2023-10-20')
$tip.Title = 'Use Out-ConsoleGridView for a cross-platform grid view'
$tip.TipText = @'
The Out-GridView cmdlet is very useful, but it only works on Windows. The Microsoft.PowerShell.ConsoleGuiTools module provides a cross-platform alternative called Out-ConsoleGridView. Rather than opening a new window, it displays the grid view in the current terminal window.
You can use Out-ConsoleGridView to display a table of data that the user is able to interactively navigate. The user can select rows from the list that can be saved to a variable or piped to another command, allowing you to perform actions on the selected rows.
'@
$tip.Example = @'
Example code to demonstrate the tip. This can also be multiple lines if needed.
'@
$tip.Urls = @(
'https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools/'
'https://github.com/PowerShell/GraphicalTools/'
)
$tip.Category = [tiPS.TipCategory]::Module # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
11 changes: 11 additions & 0 deletions src/tiPS/PowerShellTips.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,16 @@
"https://4sysops.com/archives/add-a-calculated-property-with-select-object-in-powershell/"
],
"Category": 6
},
{
"CreatedDate": "2023-10-20T00:00:00",
"Title": "Use Out-ConsoleGridView for a cross-platform grid view",
"TipText": "The Out-GridView cmdlet is very useful, but it only works on Windows. The Microsoft.PowerShell.ConsoleGuiTools module provides a cross-platform alternative called Out-ConsoleGridView. Rather than opening a new window, it displays the grid view in the current terminal window.\r\n\r\nYou can use Out-ConsoleGridView to display a table of data that the user is able to interactively navigate. The user can select rows from the list that can be saved to a variable or piped to another command, allowing you to perform actions on the selected rows.",
"Example": "Example code to demonstrate the tip. This can also be multiple lines if needed.",
"Urls": [
"https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools/",
"https://github.com/PowerShell/GraphicalTools/"
],
"Category": 2
}
]

0 comments on commit 9b349dc

Please sign in to comment.