PowerShell Script Templates

Adding standard header with disclaimer, copyright, and so on to your scripts is very easy. If you would like to (or have to – because of your company’s policies) use a certain template for your scripts – just define is as a code snippet in PowerGUI Script Editor.

Once you do that, the template is just a click- (or Ctrl-I-) away:

header_snippet(Note that snippets are alphabetically sorted so using underscore to get your ahead of others is a valid trick.)

And then, once you select the snippet you would probably get something like:

header_addedHopefully, this will save you a few extra seconds a day wasted on meaningless copy/paste. πŸ™‚

Detailed instructions on adding your code snippets can be found here.


2 Responses to “PowerShell Script Templates”

  1. 1 Vadims Podans September 4, 2009 at 6:22 pm

    Thanks! This is very useful feature in PowerGUI. This can really save my time, bacause I had to add my custom templates to scripts each time when I wrote new scripts. Now it is so easy.. πŸ™‚

  2. 2 Dmitry Sotnikov September 5, 2009 at 8:00 pm

    My pleasure. And thanks for the idea for the blog post. πŸ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

My Recent Tweets


The posts on this blog are provided β€œas is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

Β© 2007-2014 Dmitry Sotnikov

September 2009
« Aug   Oct »

%d bloggers like this: