One handy Powershell script template to rule them all

If you know me, you already know that I’m a huge fan of automation. Therefore, it’s natural to assume that I would dabble in Powershell at least once or twice or a few dozen, as a method to implement useful automations. After all, automation is pretty much the whole essence of Powershell in the first place.

As I used Powershell scripts more and more, I learned that there are a few things that are important to have whenever you use such scripts as part of automation (by “automation” I mean any sort of operation done “unattended”, i.e. without direct human interaction in real-time).

And so, a script template was born…

Taking all of what I learned and more, I wrote for myself a few handy Powershell scripts that I use as a “template” of sorts. Every time I need to start writing a new script for automation, I take a copy of that template, and add the relevant body of script that I need.

I have a few such scripts that can be downloaded from the Madeira Toolbox GitHub repository:

It’s important to remember that these “template” scripts are nothing more than good “starting points“.

As such, it’s likely that you may have to add some of your own changes in order to make them fit whatever it is you intend to do with them.

Don’t treat them like a strict form to fill out. But more like a pliable piece of dough that you can turn into any shape or form.

As always, your mileage may vary.

Happy automating!

For more details on these template scripts, please read the full post at the Madeira Data Solutions blog.

One comment

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.