From 1b8045807763727d6039614e75cacb871d009884 Mon Sep 17 00:00:00 2001 From: ruudmens Date: Mon, 23 Sep 2024 14:49:15 +0200 Subject: [PATCH 1/3] Tip - Double Tab completion --- ...arameters-properties-and-possibilities.ps1 | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 diff --git a/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 b/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 new file mode 100644 index 0000000..2a9480e --- /dev/null +++ b/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 @@ -0,0 +1,34 @@ +$tip = [tiPS.PowerShellTip]::new() +$tip.CreatedDate = [DateTime]::Parse('2024-09-23') +$tip.Title = 'Press Tab twice to view all parameters, properties and possibilities' +$tip.TipText = @' +Add `Set-PSReadlineKeyHandler -Key Tab -Function Complete` to your PowerShell profile. This way you can press the Tab key twice after a command to view all possible parameters, properties, and possiblities. + +The double tab method is similar to the normal tab completion, except it will show you all of the options at once instead of just one option at a time. + +Note: Requires the `PSReadLine` module, which is included in PowerShell 5.1 and newer. +'@ +$tip.Example = @' +# Open your PowerShell Profile: +notepad $profile + +# Add the following line: +Set-PSReadlineKeyHandler -Key Tab -Function Complete +'@ +$tip.Urls = @( + 'https://lazyadmin.nl/powershell/powershell-cheat-sheet/#good-to-know' +) +$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other. +$tip.Author = 'Rudy Mens (LazyAdmin)' # Optional. Get credit for your tip. e.g. 'Daniel Schroeder (deadlydog)'. +#$tip.ExpiryDate = [DateTime]::Parse('2024-10-30') # Optional. If the tip is not relevant after a certain date, set the expiration date. e.g. Announcing a conference or event. + +# Category meanings: +# 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. From 13c6d81455b9771f405dc90b48628cc16efd352d Mon Sep 17 00:00:00 2001 From: ruudmens Date: Mon, 23 Sep 2024 16:59:17 +0200 Subject: [PATCH 2/3] Drag file or folder to get path --- ...folder-into-powershell-to-get-the-path.ps1 | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/PowerShellTips/2024-09-23-drag-file-or-folder-into-powershell-to-get-the-path.ps1 diff --git a/src/PowerShellTips/2024-09-23-drag-file-or-folder-into-powershell-to-get-the-path.ps1 b/src/PowerShellTips/2024-09-23-drag-file-or-folder-into-powershell-to-get-the-path.ps1 new file mode 100644 index 0000000..f2ae974 --- /dev/null +++ b/src/PowerShellTips/2024-09-23-drag-file-or-folder-into-powershell-to-get-the-path.ps1 @@ -0,0 +1,24 @@ +$tip = [tiPS.PowerShellTip]::new() +$tip.CreatedDate = [DateTime]::Parse('2024-09-23') +$tip.Title = 'Drag File or Folder into PowerShell to get the path' +$tip.TipText = @' +You can drag a file or folder from the File Explorer into PowerShell to get the full path. +'@ +$tip.Example = '' +$tip.Urls = @( + 'https://lazyadmin.nl' +) +$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other. +$tip.Author = 'Rudy Mens (LazyAdmin)' # Optional. Get credit for your tip. e.g. 'Daniel Schroeder (deadlydog)'. +#$tip.ExpiryDate = [DateTime]::Parse('2024-10-30') # Optional. If the tip is not relevant after a certain date, set the expiration date. e.g. Announcing a conference or event. + +# Category meanings: +# 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. From 742f5859fca35cecffc90d888496a225f5f6e9cb Mon Sep 17 00:00:00 2001 From: ruudmens Date: Tue, 24 Sep 2024 08:58:39 +0200 Subject: [PATCH 3/3] Fix typos --- ...ce-to-view-all-parameters-properties-and-possibilities.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 b/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 index 2a9480e..e6d88d9 100644 --- a/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 +++ b/src/PowerShellTips/2024-09-23-press-tab-twice-to-view-all-parameters-properties-and-possibilities.ps1 @@ -2,7 +2,7 @@ $tip = [tiPS.PowerShellTip]::new() $tip.CreatedDate = [DateTime]::Parse('2024-09-23') $tip.Title = 'Press Tab twice to view all parameters, properties and possibilities' $tip.TipText = @' -Add `Set-PSReadlineKeyHandler -Key Tab -Function Complete` to your PowerShell profile. This way you can press the Tab key twice after a command to view all possible parameters, properties, and possiblities. +Add `Set-PSReadLineKeyHandler -Key Tab -Function Complete` to your PowerShell profile. This way you can press the Tab key twice after a command to view all possible parameters, properties, and possibilities. The double tab method is similar to the normal tab completion, except it will show you all of the options at once instead of just one option at a time. @@ -13,7 +13,7 @@ $tip.Example = @' notepad $profile # Add the following line: -Set-PSReadlineKeyHandler -Key Tab -Function Complete +Set-PSReadLineKeyHandler -Key Tab -Function Complete '@ $tip.Urls = @( 'https://lazyadmin.nl/powershell/powershell-cheat-sheet/#good-to-know'