
The trick is to build a workflow that picks up your code after you saved it (checked it in) and automatically runs the tests for you. I am lazy in that regards, I would also probably forget to do it after a while, or, because I’m human like you, become too confident with myself and just think “pff, I wrote that code, it’s awesome!” and don’t test because of that. Every time you save your file, because you just finished a new function or fixed a bug maybe, you should run your Pester tests and check for any Style atrocities.

Having Pester and PSScriptAnalyzer in your environment means that you will most likely have higher code quality than without. Pictures are easier understood than words, so that’s why I created a little diagram to explain what we are trying to accomplish here. Especially for lab environments you can pretty much get away with a “Next-Next-Done” installation.ĭownload the TeamCity source files from here:Īfter installation TeamCity will have installed the TeamCity agent on the local server so that we can dive pretty much straight in. The installation of TeamCity is very straight forward, both on Linux and Windows. These are just the most common for Windows. TeamCity is usually used as a Continuous Integration or Build server to automate builds or packaging of source / application code into deployable artefacts like MSI files, NuGet packages or plain zip files, depending on your platform. If all you do is Windows, then install it on Windows, works just as well. I do a lot of cross-platform management / automation, so Linux as the hosting platform made sense, it also has tools like git already installed. It really depends on what you will be doing with it whether it’ll be wise (or easier) to install it on Linux or Windows. You can install TeamCity on Linux and on Windows. For this demo I will stuck to my home lab CI Server TeamCity.



I have so far mostly used TeamCity and Jenkins, some customers use GO.CD or other products. It was requested of me to maybe show the integration of part 1 and part 2 into the Continuous Integration (CI) server that I used in my demos. I am currently on board flight Qantas 423 from Sydney to Melbourne, the last hop on this very long way back home from the Midwest Management Summit in Minneapolis/Minnesota USA. PowerShell tools for the advanced use cases – part 3 (this article).PowerShell tools for the advanced use cases – part 2.PowerShell Tools for the Advanced Use Cases, part 1.
