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:
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:
Is there any way to open the built-in Developer PowerShell in VS 2022 without using old window layouts?
-
Both my 2019 and 2022 versions of Visual Studio open powershell in its own window.Timothy G.– Timothy G.2022-07-30 14:50:21 +00:00Commented Jul 30, 2022 at 14:50
-
@TimothyG. may I ask which version of VS 2022 you have?SpicyCatGames– SpicyCatGames2022-07-31 09:23:52 +00:00Commented Jul 31, 2022 at 9:23
-
@spyceCatGames, Try the following command : View->TerminalAntonioHL– AntonioHL2025-01-28 07:37:25 +00:00Commented Jan 28 at 7:37
4 Answers
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".
1 Comment
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
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)