Skip to content

Commit 2c7d6f7

Browse files
thomasraynerTylerLeonhardt
authored andcommitted
Added datetimewriteverbose (#1285)
1 parent 930c33d commit 2c7d6f7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/community_snippets.md

+17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _To contribute, check out our [guide here](#contributing)._
1717
| Table of Contents |
1818
|:-----------------:|
1919
| [PSCustomObject](#pscustomobject): _A simple PSCustomObject by @brettmillerb_ |
20+
| [DateTimeWriteVerbose](#datetimewriteverbose): _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_ |
2021

2122
## Snippets
2223

@@ -41,6 +42,22 @@ A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab t
4142
}
4243
```
4344

45+
### DateTimeWriteVerbose
46+
47+
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.
48+
49+
#### Snippet
50+
51+
```json
52+
"DateTimeWriteVerbose": {
53+
"prefix": "dtwv",
54+
"body": [
55+
"Write-Verbose \"[$(Get-Date -format G)] ${1:message}\"$0"
56+
],
57+
"description": "Pre-pend datetime for Write-Verbose"
58+
}
59+
```
60+
4461
## Contributing
4562

4663
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:

0 commit comments

Comments
 (0)