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?
Visual Studio 2022 Comm. Right click project in Solution Explorer to open context menu, there you will find "Open in Terminal" command.
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".
Visual Studio 2022 Comm. Right click project in Solution Explorer to open context menu, there you will find "Open in Terminal" command.
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.
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)
© 2022 - 2025 — McMap. All rights reserved.