Visual Studio DevShell

Jason Tucker
2 min readJun 18, 2019

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.

--

--

Software Guy. Just took a DNA test turns out I’m 100% that guy that broke the build.