Skip to content

Commit db4745c

Browse files
committed
Add snippet for try-catch block
resolves #61 (comment)
1 parent 38af1ff commit db4745c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

snippets/PowerShell.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,20 @@
411411
],
412412
"description": "Param declaration with mandatory parameters"
413413
},
414+
"try-catch": {
415+
"prefix": "try-catch",
416+
"body": [
417+
"try",
418+
"{",
419+
"\t$1",
420+
"}",
421+
"catch [${exception:System.Exception}]",
422+
"{",
423+
"\t$2",
424+
"}"
425+
],
426+
"description": "try-catch exception handling"
427+
},
414428
"try-catch-finally": {
415429
"prefix": "try-catch-finally",
416430
"body": [

0 commit comments

Comments
 (0)