From c4a23cf47c488326e5437c1b2fb7cb1b5b3e322a Mon Sep 17 00:00:00 2001 From: Thomas Rayner Date: Tue, 24 Apr 2018 09:25:55 -0600 Subject: [PATCH] Added datetimewriteverbose --- docs/community_snippets.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 6e3814dfbb..d23fe15f76 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -17,6 +17,7 @@ _To contribute, check out our [guide here](#contributing)._ | Table of Contents | |:-----------------:| | [PSCustomObject](#pscustomobject): _A simple PSCustomObject by @brettmillerb_ | +| [DateTimeWriteVerbose](#datetimewriteverbose): _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_ | ## Snippets @@ -41,6 +42,22 @@ A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab t } ``` +### DateTimeWriteVerbose + +Quickly add a `Write-Verbose` with the current date and time inserted before the message you're going to write to the verbose stream, by @ThmsRynr. + +#### Snippet + +```json +"DateTimeWriteVerbose": { + "prefix": "dtwv", + "body": [ + "Write-Verbose \"[$(Get-Date -format G)] ${1:message}\"$0" + ], + "description": "Pre-pend datetime for Write-Verbose" +} +``` + ## 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: