From ef3840ae8829d462798058b01b225046d9085f22 Mon Sep 17 00:00:00 2001 From: corbob <30301021+corbob@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:33:54 -0700 Subject: [PATCH] Add Calculated Property Add Calculated Property for use in select statements. Always forgetting the syntax for this. --- docs/community_snippets.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 28a3803ba0..1764d95a70 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -16,11 +16,28 @@ _To contribute, check out our [guide here](#contributing)._ | Table of Contents | |:-----------------:| +| [CalculatedProperty](#calculatedproperty): _Create a calculated property for use in a select-object call by @corbob_ | | [PSCustomObject](#pscustomobject): _A simple PSCustomObject by @brettmillerb_ | | [DateTimeWriteVerbose](#datetimewriteverbose): _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_ | ## Snippets +### CalculatedProperty + +Create calculated property for use in Select Statements + +#### Snippet + +```json +"Add Calculated Property": { + "prefix": "cf", + "body": [ + "@{'Name' = '$1' ; 'Expression' = {$2}}", + ], + "description": "Create calculated property for use in Select Statements" +} +``` + ### PSCustomObject A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in.