Posh-Git and Posh-Hg in the same machine

Git and Mercurial have powerfull command line interfaces besides GUIs like TortoiseGit, GitExtensions and TortoiseHg.

There are two projects that I like Posh-Git and Posh-Hg. These projects add to the Powersherll terminal TAB completion and some usefull information in the prompt as shown here:

The problem that I had is that even if it is well documented how to install each one, I couldn't make both work in the same machine. There is an answer in stackoverflow which is a very good starting point, but it has a problem with the path variables used and TAB completion in mercurial seems broken after.

This is how I installed and I have both working now. First you will need to download the two repositorios to My Documents\WindowsPowerShell\Modules\ and then in My Documents\WindowsPowerShell add a file named profile.ps1 with the following content: