Of PowerShell and How There are no Small Scripts. Only Small Programmers.
How it came to be...
Recently while working on a fairly large MVC 3 project, I came to the point where my automated Team City build was no longer just performing CI for a beta testing site, but needed to deploy to multiple machines behind a balancer. I paused for a moment and decided to come back to it later.
I started to work on a different aspect of the site that was completely in JavaScript, which actually led to me sandboxing some stuff in a static HTML page as a separate project totally.
No .NET, no reference to the local JS files in that MVC project. I thought about how nice it would have been to just grab the latest version of my scripts, minimized at the CDN for the site. I had been using the Client Dependency Framework recently for script combination and minification recently, which I think is used heavily in Umbraco CMS (which I also love), but that wouldn't solve my issue in a static or Non-.NET environment.
So, I decided to just roll my own quick solution, for my scenario which would minify, version, and push static files to my CDN. I decided to just build it to do the basics first and then make it better as went along (or needed). This series is about my experience with this project and PowerShell.
PowerShell Should Be Quick...
Generally speaking, I probably would have grabbed my notepage, make a list of things I wanted the program to do, sketch some workflow maybe, and then start a new C# console application project. Then I would probably pull in whatever external libraries I would need (*hopefully* using Nuget) and start writing out some Test with whatever general functions this thing would need to accomplish. Yaddi yaddi yaddi, a little while later I would have a program that would be usable for my purposes.
This time I decided to use PowerShell. I chose to use PowerShell for two reasons:
I wasn't planning on writing a minifier from scratch, or a connectivity library to AWS. So really, this project should just be some simple code sitting on top of other programs that performs some simple tasks.
Sometimes, in small personal projects like this, it's a good idea to get out of your comfort zone. When you're working for someone else and time is of the essence, you do not suggest "hey, let's do this thing I'm not really good at", but in this case I thought it would be fun.
Wait? How do I do that again?...
In some upcoming articles I will describe my development process on this project and where I think I might be taking it. My initial run at it seems to be working for my purposes, but I need to make it more functional for a larger audience.
First run at this project is available at GitHub as my "Mini-Pusher" project now.
Discussion
No comments yet. Be the first!