Skip to content

Instantly share code, notes, and snippets.

@VimalShekar
Created January 27, 2018 07:09
Show Gist options
  • Save VimalShekar/11507592302433cfe2d4b440a61a0f17 to your computer and use it in GitHub Desktop.
Save VimalShekar/11507592302433cfe2d4b440a61a0f17 to your computer and use it in GitHub Desktop.
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter Names, zero or more>
<Brief description of parameter input required. Repeat this attribute if required>
.INPUTS <Input descriptions, zero or more>
< Brief decription of inputs to the script>
.OUTPUTS <Output descriptions, status and log files etc>
<Outputs if any, otherwise state None>
.NOTES
Author: vimalsh@live.com
Creation Date: <Date>
Changelist:
<Date> - <Purpose/Change> : <description>
.EXAMPLE
<Example explanation goes here>
<Example goes here. Repeat this attribute for more than one example>
#>
#############################################
# Script Parameters:
#############################################
# All script parameters are defined here!
Param (
#Script parameters go here
)
#region GlobalDeclarations
#############################################
# GlobalDeclarations:
#############################################
# Global variables are declared and initialised here
$global:gScriptVersion = "1.0.alpha"
#Set Error Action to Silently Continue
$ErrorActionPreference = 'SilentlyContinue'
#Import Modules & Snap-ins and additional scripts
#endregion
#region FunctionDefinitions
#############################################
# FunctionDefinitions:
#############################################
# All functions within this script are defined here!
<#
# Sample function definition
Function <FunctionName> {
Param (
)
Begin {
Write-Host '<description of what is going on>...'
}
Process {
Try {
<code goes here>
}
Catch {
Write-Host -BackgroundColor Red "Error: $($_.Exception)"
Break
}
}
End {
If ($?) {
Write-Host 'Completed Successfully.'
Write-Host ' '
}
}
}
#>
#endregion
#region ScriptMain
#############################################
# ScriptMain:
#############################################
# Execution starts here!
# Print script version for reference and to aid troubleshooting
Write-Host "Script version: $global:gScriptVersion"
#
# script actions
#
#endregion
#############################################
#signature block. Do not tamper!
#############################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment