Wednesday, May 18, 2016

Visual Studio POSH snippet, DocuComment

I am trying to get into more Visual Studio (as that is what "real" programmers use).... and to my delight, I found out that PowerShell is more supported than ever before in VS 2015.  Perhaps I can finally put away my childish things (ISE) and move onto something much more unnecessarily complicated.   So when I read about "code snippets" I was excited... but....

 No matter how much I searched, I could not find one for a simple "documentation block."  You know, the one with the ".Synopsis", and ".Example" that we are supposed to use in our scripts, but never do?  Perhaps I can make the world a better place by figuring it out and allowing others to use it.  Now you have no excuse to not document your code better, you are just three clicks away from having the "DocuComment" block created for you!

You will need to put the code below in to a file with an extension of ".snippet" and import it into VS.
(Details of this can be found at: )

DocuComment.snippet :

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="">
  <CodeSnippet Format="1.0.0">
      <Title>DocuComment Block</Title>
      <Description>Code snippet for a comment block.</Description>
      <Author>Bryan Loveless</Author>

            synopsis of script, overall idea


            description of overall script, more detail than synopsis

            .PARAMETER parameternamehere

            parameter description, if required, possible values

            .PARAMETER path

            parameter path


            example of script use, return behavior.


            another exmample if there are more.  This can be repeated for as many examples as you want


            other misc notes, perhaps permissions needed, dates of script.
      <References />
      <Code Language="PowerShell">
$selected$ $end$

1 comment:

  1. Wonderful blog.. Thanks for sharing informative Post. Its very useful to me.

    Installment loans
    Payday loans
    Title loans