23

In Visual Studio 2022, you can open the Developer PowerShell from Tools>Command Line>Developer PowerShell

In the previous versions of Visual Studio, it used to open the built in PowerShell window:

screenshot of the old developer powershell

I can still access this if I use my old window layouts. So it still exists.

However, In VS 2022, if I try to open it from Tools>Command Line>Developer PowerShell, it just opens up a separate window:

screenshot of the new developer powershell

Is there any way to open the built-in Developer PowerShell in VS 2022 without using old window layouts?

3
  • Both my 2019 and 2022 versions of Visual Studio open powershell in its own window. Commented Jul 30, 2022 at 14:50
  • @TimothyG. may I ask which version of VS 2022 you have? Commented Jul 31, 2022 at 9:23
  • @spyceCatGames, Try the following command : View->Terminal Commented Jan 28 at 7:37

4 Answers 4

33

In a newer version of VS 2022, the Developer PowerShell has been moved to View > Terminal it seems. Confusingly, Tools > Command Line >Developer PowerShell opens up the Windows PowerShell.

Learn more at learn.microsoft.com

Edit: It seems there's a new Developer PowerShell now that is accessible from the start menu as a separate executable. This is what opens up if you try to open Developer PowerShell from Tools in VS. The confusion comes from the integrated "terminal" still being named "Developer PowerShell".

Sign up to request clarification or add additional context in comments.

1 Comment

The naming and menu layout is so confusing. As far as I can tell, 'Developer' just means they have set some env vars for you, and it's still just the system-installed powershell.exe or cmd.exe. And the two different menu locations just correspond to 'open in VS dockable panel' or 'open in separate window'. I wish all the menu entries were in the same place and were explicit about what you get.
9

Visual Studio 2022 Comm. Right click project in Solution Explorer to open context menu, there you will find "Open in Terminal" command.

Comments

0

The developer command line tools are installed here:

Get-ChildItem 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\'

You can view the VsDevCmd.bat batch file or Launch-VsDevShell.ps1 PowerShell script to see what they do. In short, they are scripts that are invoked by the default Windows system programs. PowerShell, for example, is located here:

Get-ChildItem 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\'

It's worth noting that they do not define the same environment variables, which is rather annoying.

1 Comment

This doesn't answer the question. From the images you can see that what I wanted is the embedded UI, not the separate developer powershell.
0

You can also make a desktop shortcut which I think is way more useful and easier to find.

  • Click on Start Menu->Navigate to V and expand "Visual Studio 2022"
  • You should see "Developer Powershell for VS 2022"
  • Copy the shortcut to your desktop

Modify the shortcut with your glorious newer Powershell - mine is 7.4.4

  • Right click on the copied shortcut and press 'r' (for properties)

  • Edit the 'target' with the location of your new Powershell. For example mine became:

    "C:\Program Files\PowerShell\7\pwsh.exe" -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell 6cc551b1}"

I also changed the "Start in" to c:\Temp - could have chosen my c:\Workspace instead

  • Click Ok.
  • Done.

You have now an easily accessible Powershell command prompt for building Visual Studio things via command line. (The only drawback is when you update Powershell to a newer version and it goes to a different, newer folder, but hey, it's way more fresh than the old 5.1)

1 Comment

This doesn't answer the question. From the images you can see that what I wanted is the embedded UI, not the separate developer powershell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.