From 614de7bdfcc72181bf98afe349adb725d0053b6d Mon Sep 17 00:00:00 2001 From: JB Lewis Date: Thu, 11 Jul 2019 14:27:30 -0500 Subject: [PATCH 1/2] Update PowerShell.json Added a basic parameter block (At line 574) that includes the cmdletbinding attribute. As a user I would like a snippet to make it easier to add a param() section with one parameter declaration to get it started. The cursor is deposited to the right of the parameter variable. If the user would like to add more parameters, they can type the comma, and proceed to use the "param" snippet to add another parameter. This addresses issue #2080 --- snippets/PowerShell.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 6707fcfb8b..49826c47ff 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -571,6 +571,17 @@ ], "description": "Parameter declaration snippet" }, + "Parameter_Block" : { + "prefix": "param-block", + "body": ["[CmdletBinding()]", + "param (", + " [parameter()]", + " [${1:TypeName}]", + " $${2:ParameterName}$0", + ")" + ], + "description": "A Parameter block to get you started." + }, "Parameter-Path": { "prefix": "parameter-path", "body": [ From fce5312deee24faf4436ebdb96df9beeee1287ac Mon Sep 17 00:00:00 2001 From: JB Lewis Date: Thu, 11 Jul 2019 19:19:07 -0500 Subject: [PATCH 2/2] Update snippets/PowerShell.json Co-Authored-By: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> --- snippets/PowerShell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 49826c47ff..b98472f56b 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -575,7 +575,7 @@ "prefix": "param-block", "body": ["[CmdletBinding()]", "param (", - " [parameter()]", + " [Parameter()]", " [${1:TypeName}]", " $${2:ParameterName}$0", ")"