Use a Header on your Scripts

I know, it sounds silly we have to say this, but use a header on your scripts or you will lose track of the development path…

#*************************************************************
# Script Name : 
# Location    : 
# Purpose     : 
# Date        :  #Get-Date -Format "MMMM d, yyyy h:mm:ss tt"
# - Initial Version
# Date        : 
# - Updated
# Author      : Patrick Burwell, [email protected]
#*************************************************************
#Make sure the TLS goes on EVERY script!!!
# First, ensure TLS 1.2 for PowerShell gallery access.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

#Include this on all scripts
#if(!(Get-ExecutionPolicy ) -eq "Bypass"){
#Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass  -Force |Out-Null
#Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Bypass  -Force |Out-Null
#}

As you can see, having a header helps keeps track of when you created the script, gives your client details on who made the script, so they can reach out after you have moved on for help if needed, and also offers a good place to put the needed ‘toppers’ for your script as well (stuff you need on every script).

We use a Powershell-Helps.ps1 file to track useful options we can then grep for later, because who remembers everything but eidetic people?


Posted

in

,

by

Tags: