This is part 1 of a 3 part series, in which I will be creating a PowerShell script that accepts as input a folder location via a standard windows popup dialog and then performs some repetitive action. I’ll get to the details in the next post where I actually build the script. In the 3rd post will be putting it to use…
But first some background on PowerShell and some details on my awkward attachment to it, back in December 2007 I attended a Readify (RDN) session about PowerShell presented by Mitch Denny and was blown away by its potential and power, along with an attention grabbing demo of it running a Space Invaders game. I proceeded to adapt his demo and do my own investigation and the following month demonstrated the PowerShell concepts internally to my colleagues who specialise in the .NET development space.
I was trying to promote the use of PowerShell to replace a large collection of batch (.bat) scripts we were using at the time across many projects, to do things ranging from mass source control check-outs/check-ins to building deployments of production packages, yes **shudder**. Sadly more often than not, I did not make time to improve and replace all batch scripts I encountered either through the use of PowerShell or alternate approaches to running a script.
Double checking with this post on the MSDN PowerShell blog, I can confirm that at the time it was the first CTP release of PowerShell 2.0 that got my attention. With my switch now to Windows 7 and currently working on a new laptop it was fantastic to see an already installed out of the box PowerShell, which I simply searched for by typing into my start menu.
A few months back I discovered a site that got my attention again with little tips and video tutorials about using PowerShell, sadly a lot of their videos are no longer available, but I still subscribe to an almost daily newsletter with 1 single tip per day. So for a while I’ve been amassing the emails from PowerShell.com in one of my gmail accounts, labelling them thinking “oh that’s cool tip” but not having the time to test it out. Well the other day the “perfect” tip for a planned task came along to get me cracking on this script and blog posts.
In the next post I’ll be running through its actual creation.