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:
- KuCommon containing most commonly used functions like navigation, integration with an environment, search, security, shell, etc.
- KuDevelopment containing useful shortcuts for the most used development tasks that can be automated at some level – working with NuGet, version control management (do not mix with source control), visual studio, etc.
- KuTfsScm containing basic shortcuts for working with TFS source control system
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
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:
1 2 3 4 5 6 7 8 9
$ Find-InPaths powershell.??? C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe $ f powershell* C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Windows\System32\WindowsPowerShell\v1.0\PowerShellCore.format.ps1xml C:\Windows\System32\WindowsPowerShell\v1.0\PowerShellTrace.format.ps1xml C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe.config $
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
Import-VisualStudioEnvironment will be automatically called.
There is also some functionality devoted for version control (specifically for incrementing
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:
Author Roman Kuznetsov
License Roman Kuznetsov