PowerShell as part of Efficient Development Environment

Posted in category powershell on 2013-08-15
Tags: powershell

Table of Contents

In this post I will present my small scripting project KuModules. It’s main purpose is to build more efficient and convenient development environment. It is now hosted on GitHub and free for everyone to use or contribute. Well, let me start from saying that I’m the kind of person that spends quite a bit of my time in the console :) and I definitely prefer to have some useful functionality at my hands at any time.

KuModules project is structured as a set of modules with distinctive separation of concerns:

Modules are hierarchically dependent on each other: KuTfsScm is dependent on KuDevelopment and KuCommon, KuDevelopment is dependent on KuCommon. So, if you will try importing KuTfsScm module for example, you will end up having three modules imported: KuCommon, KuDevelopment and KuTfsScm.

Installation procedure is super simple and only requires you to run this command in you powershell session (just copy and paste, nothing serious):

In order to automatically have this functionality, just place this code into your $PROFILE script:

Let me now go through some of the use case scenarios in each module and in order not to make it terribly boring I will skip most of it for the most curious of you who will go and try it out your selves :).


Most noticeable in this module is probably navigation/bookmark management functionality. Everything is controlled with single function go which can navigate to bookmarked path, persist a new bookmark or remove existing one.

Another interesting functionality is to search for programs in the paths as they defined in the %PATH% environment variable:


Most important functions here are devoted for working with Visual Studio:

In order to get access to all Visual Studio Command Prompt Tools it’s required to import all visual studio variables with Import-VisualStudioEnvironment. But you should not be bothered calling it every time you start new powershell console - it’s enough to make sure KuDevelopment module is imported as Import-VisualStudioEnvironment will be automatically called.

There is also some functionality devoted for version control (specifically for incrementing versions in AssemblyInfo.cs files):

These function work only on C# projects at the moment!

The first one will take your AssemblyInfo.cs file and change it to have incremented versions (by Major, Minor, Revision or Build). Whether the second one will go through all of such files in your solution and update it respectively. Here is a bit of the demonstration for you:

There is another, probably the most important function (for me anyway :) ) - the function that builds your solution, runs all your unit-tests and reports a detailed summary: