Collect commands that should be templates #7492
Replies: 3 comments 1 reply
-
Great idea! Can we have some kind of documentation to each snippet with some information about the "why"? Because sometimes I see code in a way that I would not use. After asking other contributors about the why and hearing the explaination - it's totally clear why we have the code this way. |
Beta Was this translation helpful? Give feedback.
-
A basic output snippet for Remove- commands would be helpful as well: Here is an example about the "why" - the comment in the first line. It is not the case in every situation, but a developer should be aware of that. |
Beta Was this translation helpful? Give feedback.
-
I don't know if we already agreed on the "best" way to use parameters but some snippets for that would be great as well: |
Beta Was this translation helpful? Give feedback.
-
I'm looking to start collecting commands or snippets that we want to now use as the standard in commands. Since we created the templates repo many patterns we had started with have changed now.
The goal moving forward will be to drop these snippets and command templates into proper snippets for support with VS Code. This is a one started years ago that is now outdated as well, dbatools.code-snippets. Once we have this updated we can drop the template repo since it is no longer maintained.
An example. Those commands that directly support piping from the parent
Get
function could live on this pattern used inRemove-DbaDbSequence
:This gets turned into a snippet formatted block:
The
${x:description}
is annotations in snippets that will be tab accessible once it is inserted into the Editor of Code. When you repeat the use of the${x}
it will auto-fill that value, only requires entering it once and done.@potatoqualitee @niphlod @andreasjordan looking to replies added to this discussion with the link to the command (as a whole) or the snippet (permalink) of code that we want to use (or like 🧇 ). Once we have a decent amount I'll create PRs to get them formatted and added into the snippet file.
Once I'm able to start working on Pester 5 conversion I'll add snippet support for that as well.
Beta Was this translation helpful? Give feedback.
All reactions