Skip to content

Commit 2b01cc8

Browse files
JustinGroteandyleejordan
authored andcommitted
ArgumentCompleterAttribute Updates
1 parent d71021b commit 2b01cc8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

snippets/PowerShell.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// The "Requires *" snippets should be removed if-and-when intellisense is implemented for the script requirement directive syntax.
22
{
33
"ArgumentCompleterAttribute": {
4-
"prefix": "argumentcompleter",
5-
"description": "The ArgumentCompleter attribute allows you to add tab completion values to a specific parameter by writing a scriptblock that generates zero or more CompletionResult objects. More: Get-Help -Online about_functions_argument_completion",
4+
"prefix": [
5+
"argumentcompleter",
6+
"[ArgumentCompleter("
7+
],
8+
"description": "ArgumentCompleter attribute allows you to add tab completion values to a specific parameter by writing a scriptblock that generates zero or more CompletionResult objects. More: Get-Help about_Functions_Argument_Completion",
69
"body": [
710
"[ArgumentCompleter({",
811
"\t[OutputType([System.Management.Automation.CompletionResult])]",
@@ -15,15 +18,17 @@
1518
"\t)",
1619
"\t",
1720
"\t${1:$TM_SELECTED_TEXT}",
18-
"\t#Output one or more of these objects: [Management.Automation.CompletionResult]'MyPotentialResult'",
1921
"})]${0}"
2022
]
2123
},
2224
"CalculatedProperty": {
23-
"prefix": "Calculated-Property",
24-
"description": "Creates a Calculated Property typically used with Select-Object.",
25+
"prefix": [
26+
"calculated-property",
27+
"@{Name"
28+
],
29+
"description": "Calculated Property typically used with Select-Object or Sort-Object. More: Get-Help about_Calculated_Properties",
2530
"body": [
26-
"@{name='${1:PropertyName}';expression={${2:${TM_SELECTED_TEXT:\\$_.PropertyValue}}}}$0"
31+
"@{Name='${1:PropertyName}';Expression={${2:${TM_SELECTED_TEXT:\\$_.PropertyValue}}}}$0"
2732
]
2833
},
2934
"Class": {

0 commit comments

Comments
 (0)