Visual Studio DevShell

Jason Tucker

I haven’t really been keeping up with the new Visual Studio 2019 previews but I didn’t come across an interesting feature after I updated to the latest Preview bits: The Developer Console but powered by PowerShell.

The app title can be found in your Start menu.

Clicking on this opened up a new window and loaded that all to familiar view but this time I have my (albeit not fully visualized) PowerShell prompt

Now I have all the wonders of the Developer Command Prompt but with PowerShell power and all is good in the world.

Except, I’d rather get access to this in my normal terminal. So after dissecting the shortcut I added the following lines to my $PROFILE so that I can get the command prompt configuration whenever I open a new prompt.

So, what is happening here?

First, using vshwere, I determine the location of the version of 2019 that I have installed on my machine. Because I only use 1 version and that’s the preview release, I have to pass that flag to vshwere to make sure it’s found. I grab the installationpathproperty from the results and store that in a variable.

Now that I have that I can import the module Microsoft.VisualStudio.DevShell into my environment. Once that’s imported, it’s a trivial call to Enter-VsDevShell with the already captured installation path. I ultimately send that to $nullso that I don’t see the banner that usually shows up when you enter the shell.

Now I can go about using the utils that I’m accustomed too which is mostly these days the tf command.

Jason Tucker

Written by

In a world where nothing is as it seems, jtucker is the only man to make sense of it all.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade