I am working on a .NET internal test tool at the moment. The tool is GUI based at the moment. One of the things I want the tool to be able to do is to run in command line mode. This way we can run it in an automated fashion and have it crunch on some data every day.
We started to put in a Command line mode in it but I am just not happy with it. It feels clumsy-ish and just tacked on. I am looking for a more elegant solution that will scale relatively easily as we provide more functionality to the app.
One of the thoughts I had is modeled after PowerShell and Exchange Server. Exchange server apparently built some 800 cmdlets and then used them to build their UI on top of. This way everything their UI can do, you can do via a script using those cmdlets. I really like that to be honest. It’s elegant and scales naturally as they add more functionality.
What ideas do you guys have for something like this? Anyone out there tried the PowerShell route I mentioned? Share your thoughts.
Thanks
Powershell scripts allow you to take advantage of .NET libraries and write scripts which are almost as powerful as the .NET code itself. You can do many powerful operations like call external DLLs, use .NET namespaces like System.IO, System.Net, run processes and intercept output, call web services etc. The possibilities are endless. Here, I will show you a Powershell script which assists you in day to day deployment of websites. Everyday, we make changes to web projects, which need to be deployed to development servers, sometimes on beta servers, and finally on the production server. Using this script, you can automate all the manual work that you do again and again on your deployment package every time you upload your website to some server. We use this script in Pageflakes every single day during our local development server upload, beta release, and final production server release. All we do is run the script, go to the server, and extract a zip file on the web folder, and that’s all. The new version gets deployed within two minutes without any manual work at all, and completely removes any possibility of human error during deployment.
Automating deployment
i have written a Powershell script does the following for you:
After the deployment script runs, all you need to do is extract the zip file on the server and that’s all!
You can easily FTP the modified files instead of copying only the zip file, by changing the FTP part at the end of the script.