-
Notifications
You must be signed in to change notification settings - Fork 0
/
powershell.json
77 lines (77 loc) · 2.23 KB
/
powershell.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"Try Catch": {
"prefix": "tryc",
"body": [
"try{",
"\t$0",
"}",
"catch{",
"\t$1",
"}"
],
"description": "Try Catch"
},
"Try Catch Finally": {
"prefix": "trycf",
"body": [
"try{",
"\t$0",
"\t1/0",
"}",
"catch[DivideByZeroException]{",
"\tWrite-Host \"Divide by zero exception\"",
"}",
"catch[System.Net.WebException],[System.Exception]{",
"\tWrite-Host \"Other exception\"",
"}",
"finally{",
"\tWrite-Host \"cleaning up ...\"",
"}"
],
"description": "Try Catch Finally"
},
"Cmdlet": {
"prefix": "cmdlet",
"body": [
"<#",
".Synopsis",
"Short description",
".DESCRIPTION",
"Long description",
".EXAMPLE",
"Example of how to use this cmdlet",
".EXAMPLE",
"Another example of how to use this cmdlet",
"#>",
"function Verb-Noun",
"{",
"\t[CmdletBinding()]",
"\t[Alias()]",
"\t[OutputType([int])]",
"\tParam",
"\t(",
"\t\t# Param1 help description",
"\t\t[Parameter(Mandatory=$$true,",
"\t\t\tValueFromPipelineByPropertyName=$$true,",
"\t\t\tPosition=0)]",
"\t\t$$Param1,",
"",
"\t\t# Param2 help description",
"\t\t[int]",
"\t\t$$Param2",
"\t)",
"",
"\tBegin",
"\t{",
"\t}",
"\tProcess",
"\t{",
"\t}",
"\tEnd",
"\t{",
"\t}",
"}"
],
"description": "Cmdlet (Advanced Function)"
}
}