diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 3c684969a5..053c863ff2 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -28,6 +28,7 @@ _To contribute, check out our [guide here](#contributing)._ | [PesterTestForMandatoryParameter](#pestertestformandatoryparameter) | _Create Pester test for a mandatory parameter_ | | [PesterTestForParameter](#pestertestforparameter) | _Create Pester test for parameter_ | | [PSCustomObject](#pscustomobject) | _A simple PSCustomObject by @brettmillerb_ | +| [Region Block](#region-block) | _Region Block for organizing and folding of your code_ | ## Snippets @@ -271,6 +272,7 @@ Quickly create a Pester Test for existence of a parameter by @SQLDBAWithABeard "description": "Pester Test for Parameter" } ``` + ### PSCustomObject A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in. @@ -292,6 +294,24 @@ A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab t } ``` +### Region Block + +Use the `#region` for organizing your code (including good code folding). + +#### Snippet + +```json +"Region Block": { + "prefix": "#region", + "body": [ + "#region ${1}", + "${2}", + "#endregion" + ], + "description": "Region Block for organizing and folding of your code" +} +``` + ## Contributing If you'd like to add a snippet to this list, [open a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) with the following changes: diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index e02f9f76c2..753ae61430 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -943,5 +943,14 @@ "}" ], "description": "Creates a Hashtable" + }, + "Region Block": { + "prefix": "#region", + "body": [ + "#region ${1}", + "${2}", + "#endregion" + ], + "description": "Region Block for organizing and folding of your code" } }