I recently went to Midwest Management Summit aka MMS (and if you are in the ConfigMan world and don’t go then you are missing out). A few of the sessions I attended were centered around scripting and how to improve things. One thing that was brought up a few times is having a standard on how your scripts are formatted. This is important as it helps when viewing the script to understand what it does and doing any work on the script. With that I developed the following PowerShell template I would like to share.
I did a few searches to get an idea of how others formatted their scripts and what to include in my template. What I found was that I was leaving a lot out of my previous scripts. Now that I have this that will no longer be the case.
.SYNOPSIS
Script synopsis
.SYNTAX
Script syntax
.DESCRIPTION
Script description
.PARAMETER
Parameter input descriptions and repeat this as needed for each parameter
.INPUTS
Input description if used
.OUTPUTS
Output description if used
.NOTES
FileName:
Author:
Contact:
Created:
Modified:
Version:
.EXAMPLE
Example description and example
#>
#-----Parameters-----
Param (
)
#-----Initializations and Module Imports-----
#-----Variables-----
#-----Functions-----
#-----Execution-----