As a best practice, most script authors adds a header to their scripts containing some basic information like the script name, the author and version history.
Some commercial script editors, like Idera
s PowerShell Plus, contains script-templates to make this easier. PowerGUI is another commercial editor, available both in a free and Pro version. This product doesnt contain any script templates by default, however it
s easy to extend the product with needed functionality by building Add-ons. Ive created an add-on named Script Template, available here.
When creating a new document in the PowerGUI Script editor, the following template is automatically inserted when the Add-on is loaded:
The easiest way to install the Add-on is by using Tools->Find Add-ons Online:
Search for “script template” and then press “Install”.
If you want to customize the template you can open the file DocumentsWindowsPowerShellModulesAdd-on.ScriptTemplateAdd-on.ScriptTemplate.psm1 and modify the following section:
Note that the first new document automatically created when opening the PowerGUI Script Editor won
t get pre-filled with the script template header, since the Script Template Add-on isnt loaded yet. However, all consecutive new documents will get the template automatically.
A similar Add-on is available here for PowerShell ISE, created by PowerShell MVP Ravikanth Chaganti.