In my attempts to automate the world I learned myself some powershell, and got myself in trouble along the way. But I got to know some very friendly and helpful people along the way, I got a lot of help from Ravikanth Chaganti (blog|twitter). And he got me thinking with this comment on my blog.

you can use the PowerShell console extention to access the $dte object and see what project was open and reopen it later. You can actually script it inside the Visual Studio environment. Check PowerGUIVSX, etc

So I did not listen and installed Powerconsole instead ;-). Powerconsole is an extension which can easily be installed via the extension manager.

After a Visual studio restart you can then open a powerconsole window by going to the view menu(see picture).

Now that you have to open you have access to the $dte variable, which has lots of members to play with.

First thing to do was to find out if I could use git from there. But I had a problem there.

The problem is that the workingdirectory of the powerconsole is not the same as your solution.

But we can fix that (if you know how) and I found a helpful blogpost on the net that had what I wanted.

And now I can continue on my quest to find the holy grail.

I am very happy with my quest so far, since I have learned lots of new things on found out that there are a lot of helpful people in the Powershell world. I actually find the lack of semicolons in Powershell refreshing. And I should have learned this earlier.