Skip to content

Commit c27793e

Browse files
Merge pull request #14176 from cdpark/refresh-vs-2022
Feature 474055: Q&M: Freshness work for VS, 3 articles
2 parents a47baa0 + a99cd63 commit c27793e

File tree

6 files changed

+70
-74
lines changed

6 files changed

+70
-74
lines changed

docs/ide/reference/command-prompt-powershell.md

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: 'Command-line shells & prompt for developers'
3-
description: Start from the Tools > Command Line menu. Select the Visual Studio Developer Command Prompt, Developer PowerShell, or terminal to use .NET and C++ tools more easily.
2+
title: Command-Line Shells & Prompt For Developers
3+
description: Learn about the two command-line shells for developers in Visual Studio, the Developer Command Prompt and the Developer PowerShell.
44
author: Mikejo5000
55
ms.author: mikejo
6-
ms.date: 08/23/2024
6+
ms.date: 08/06/2025
77
ms.topic: conceptual
88
helpviewer_keywords:
99
- "Visual Studio command prompt"
@@ -19,23 +19,23 @@ ms.subservice: general-ide
1919

2020
Visual Studio includes two command-line shells for developers, a command prompt and an instance of PowerShell, as follows:
2121

22-
- **Visual Studio Developer Command Prompt** - A standard command prompt with certain environment variables set to make using command-line developer tools easier.
22+
- **Visual Studio Developer Command Prompt**: A standard command prompt with certain environment variables set to make using command-line developer tools easier.
2323

2424
::: moniker range="vs-2019"
25-
:::image type="content" source="media/developer-command-prompt-for-vs/command-prompt.png" alt-text="Screenshot of the Developer Command Prompt for Visual Studio 2019 showing clrver tool.":::
25+
:::image type="content" source="media/developer-command-prompt-for-vs/command-prompt.png" alt-text="Screenshot of the Developer Command Prompt for Visual Studio 2019.":::
2626
::: moniker-end
2727

2828
::: moniker range=">=vs-2022"
29-
:::image type="content" source="media/developer-command-prompt-for-vs/developer-command-prompt-visual-studio-2022.png" alt-text="Screenshot of the Developer Command Prompt for Visual Studio that shows the clrver tool.":::
29+
:::image type="content" source="media/developer-command-prompt-for-vs/developer-command-prompt-visual-studio-2022.png" alt-text="Screenshot of the Developer Command Prompt for Visual Studio.":::
3030
::: moniker-end
3131

32-
- **Visual Studio Developer PowerShell** - More powerful than a command prompt. For example, you can pass the output of one command (known as a *cmdlet*) to another cmdlet. This shell has the same environment variables set as Developer Command Prompt. Available since Visual Studio 2019.
32+
- **Visual Studio Developer PowerShell**: More powerful than a command prompt. For example, you can pass the output of one command, known as a *cmdlet*, to another cmdlet. This shell has the same environment variables set as Developer Command Prompt. Available since Visual Studio 2019.
3333

3434
::: moniker range=">=vs-2022"
3535
:::image type="content" source="media/developer-command-prompt-for-vs/developer-powershell-visual-studio-2022.png" alt-text="Screenshot of the Developer PowerShell tool in Visual Studio 2022 and later.":::
3636
::: moniker-end
3737

38-
Starting in [Visual Studio 2019](https://devblogs.microsoft.com/visualstudio/say-hello-to-the-new-visual-studio-terminal/), Visual Studio includes an integrated **terminal** that can host either of these shells (Developer Command Prompt and Developer PowerShell). You can also open multiple tabs of each shell. The Visual Studio terminal is built on top of [Windows Terminal](/windows/terminal/). To open the terminal in Visual Studio, select **View** > **Terminal**.
38+
Starting in Visual Studio 2019, Visual Studio includes an [integrated terminal](https://devblogs.microsoft.com/visualstudio/say-hello-to-the-new-visual-studio-terminal/) that can host either of these command-line shells. You can also open multiple tabs of each shell. The Visual Studio terminal is built on top of [Windows Terminal](/windows/terminal/). To open the terminal in Visual Studio, select **View** > **Terminal**.
3939

4040
::: moniker range=">=vs-2022"
4141
:::image type="content" source="media/developer-command-prompt-for-vs/visual-studio-2022-terminal-window.png" alt-text="Screenshot of the Visual Studio terminal pane that shows multiple tabs.":::
@@ -50,7 +50,7 @@ Starting in [Visual Studio 2019](https://devblogs.microsoft.com/visualstudio/say
5050
5151
When you open one of the developer shells from Visual Studio, either as a separate app or in the Terminal window, it opens to the directory of your current solution (if you have a solution loaded). This behavior makes it convenient to run commands against the solution or its projects.
5252

53-
Both shells have specific environment variables set that enable you to use command-line developer tools more easily. After opening one of these shells, you can enter the commands for different utilities without having to know where they're located.
53+
Both shells have specific environment variables that enable you to use command-line developer tools more easily. After opening one of these shells, you can enter the commands for different utilities without having to know where they're located.
5454

5555
|Popular commands|Description|
5656
|--|--|
@@ -73,52 +73,44 @@ Follow these steps to open Developer Command Prompt or Developer PowerShell from
7373
1. On the menu bar, select **Tools** > **Command Line** > **Developer Command Prompt** or **Developer PowerShell**.
7474

7575
::: moniker range=">=vs-2022"
76-
:::image type="content" source="media/developer-command-prompt-for-vs/visual-studio-2022-command-line-menu.png" alt-text="Screenshot of the Command Line menu in Visual Studio 2022 and later.":::
76+
:::image type="content" source="media/developer-command-prompt-for-vs/visual-studio-2022-command-line-menu.png" alt-text="Screenshot of the Command Line menu in Visual Studio.":::
7777
::: moniker-end
7878

7979
::: moniker range="vs-2019"
80-
![Screenshot of the Command Line menu in Visual Studio 2019.](./media/developer-command-prompt-for-vs/vs-menu.png)
81-
::: moniker-end
82-
80+
:::image type="content" source="media/developer-command-prompt-for-vs/vs-menu.png" alt-text="Screenshot of the Command Line menu in Visual Studio 2019.":::
81+
::: moniker-end
82+
8383
## Start from Windows menu
8484

85-
Another way to start the shells is from the Start menu. You may have multiple command prompts, depending on the version of Visual Studio and any additional SDKs and workloads you've installed.
85+
Another way to start the shells is from the Start menu. You could have multiple command prompts, depending on the version of Visual Studio and any other SDKs and workloads you've installed.
8686

8787
### Windows 11
8888

89-
1. Select **Start** :::image type="content" source="media/developer-command-prompt-for-vs/windows-11-logo-button.png" alt-text="Screenshot of the Start button in Windows 11.":::, and then in the **Type here to search** dialog box, enter either `developer command prompt` or `developer powershell`.
89+
1. Select **Start**, and then in the **Type here to search** dialog box, enter either `developer command prompt` or `developer powershell`.
9090

9191
1. Select the App result that's associated with your search text.
9292

9393
### Windows 10
9494

95-
1. Select **Start** ![Screenshot of the Start button in Windows 10.](./media/developer-command-prompt-for-vs/windows-logo-key-graphic.png), and then scroll to the letter **V**.
95+
1. Select **Start**, and then scroll to the letter **V**.
9696

9797
1. Expand the **Visual Studio 2019** or **Visual Studio 2022** folder.
9898

9999
1. If you're running Visual Studio 2019, select either **Developer Command Prompt for VS 2019** or **Developer PowerShell for VS 2019**. If you're running Visual Studio 2022, select either **Developer Command Prompt for VS 2022** or **Developer PowerShell for VS 2022**.
100100

101101
Alternatively, you can start typing the name of the shell in the search box on the taskbar, and select the result you want as the result list starts to display the search matches.
102102

103-
![An animation that shows the search behavior in Windows 10.](./media/developer-command-prompt-for-vs/windows-10-search.gif)
104-
105-
### Windows 8.1
106-
107-
1. Go to the **Start** screen, by pressing the Windows logo key ![Screenshot of the Windows logo key on the keyboard.](./media/developer-command-prompt-for-vs/windows-logo-key-graphic.png) on your keyboard for example.
108-
109-
1. On the **Start** screen, press **Ctrl**+**Tab** to open the **Apps** list, and then press **V**. This brings up a list that includes all installed Visual Studio command prompts.
110-
111-
1. If you're running Visual Studio 2019, select either **Developer Command Prompt for VS 2019** or **Developer PowerShell for VS 2019**. If you're running Visual Studio 2022, select **Developer Command Prompt for VS 2022** or **Developer PowerShell for VS 2022**.
103+
:::image type="content" source="media/developer-command-prompt-for-vs/windows-10-search.gif" alt-text="Animation that shows the search behavior in Windows 10.":::
112104

113105
## Start from file browser
114106

115-
Usually, the shortcuts for the shells you have installed are placed in the **Start Menu** folder for Visual Studio, such as in *%ProgramData%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2019\Visual Studio Tools*. But if searching for the command prompt doesn't produce the expected results, you can try to manually locate the files on your machine.
107+
Usually, the shortcuts for the shells you installed are placed in the **Start Menu** folder for Visual Studio, such as in *%ProgramData%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2019\Visual Studio Tools*. But if searching for the command prompt doesn't produce the expected results, you can try to manually locate the files on your machine.
116108

117109
### Developer Command Prompt
118110

119111
Search for the name of the command prompt file, which is *VsDevCmd.bat*, or go to the Tools folder for Visual Studio, such as *%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\Tools* (the path changes according to your Visual Studio version, edition, and installation location).
120112

121-
Once you've located the command prompt file, open it by entering the following command in a regular command prompt window:
113+
After you locate the command prompt file, open it by entering the following command in a regular command prompt window:
122114

123115
::: moniker range="vs-2022"
124116

@@ -148,21 +140,22 @@ Or enter the following command in the Windows **Run** dialog box:
148140

149141
::: moniker-end
150142

151-
Since Visual Studio 2015, the Developer Command Prompt sets the `VSCMD_VER` environment variable which contains the version information for Visual Studio (ex: `17.9.0`). If you need to detect whether the Developer Command Prompt has already been run in your console, it is recommended to check whether `VSCMD_VER` has been defined or not.
143+
Since Visual Studio 2015, the Developer Command Prompt sets the `VSCMD_VER` environment variable, which contains the version information for Visual Studio (for example: 17.14.8). If you need to detect whether the Developer Command Prompt was already run in your console, it's recommended to check whether `VSCMD_VER` has been defined or not.
152144

153145
> [!TIP]
154146
> Make sure to edit the path to match the version or edition of Visual Studio that you're using.
155147
156148
### Developer PowerShell
157149

158-
Search for a PowerShell script file named *Launch-VsDevShell.ps1*, or go to the Tools folder for Visual Studio, such as *%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools*. (The path changes according to your Visual Studio version, edition, and installation location.) Once you've located the PowerShell file, run it by entering the following command at a Windows PowerShell or PowerShell 6 prompt.
150+
Search for a PowerShell script file named *Launch-VsDevShell.ps1*, or go to the Tools folder for Visual Studio, such as *%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools*. The path changes according to your Visual Studio version, edition, and installation location. After you locate the PowerShell file, run it by entering the following command at a Windows PowerShell or PowerShell 6 prompt.
159151

160152
::: moniker range="vs-2022"
161153
For Visual Studio 2022:
162154

163155
```powershell
164156
& 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1'
165157
```
158+
166159
::: moniker-end
167160

168161
For Visual Studio 2019:
@@ -176,18 +169,18 @@ By default, the Developer PowerShell that launches is configured for the Visual
176169
> [!TIP]
177170
> The [execution policy](/powershell/module/microsoft.powershell.core/about/about_execution_policies) must be set in order for the cmdlet to run.
178171
179-
The `Launch-VsDevShell.ps1` script works by locating the `Microsoft.VisualStudio.DevShell.dll` PowerShell module in the Visual Studio installation path, loading it, and then invoking the `Enter-VsDevShell` cmdlet. Installed shortcuts, like those in the Start menu, load the module and invoke the cmdlet directly. `Launch-VsDevShell.ps1` is the recommended way to initialize Developer PowerShell interactively or for scripting build automation.
172+
The *Launch-VsDevShell.ps1* script works by locating the *Microsoft.VisualStudio.DevShell.dll* PowerShell module in the Visual Studio installation path, loading it, and then invoking the `Enter-VsDevShell` cmdlet. Installed shortcuts, like those in the Start menu, load the module and invoke the cmdlet directly. *Launch-VsDevShell.ps1* is the recommended way to initialize Developer PowerShell interactively or for scripting build automation.
180173

181174
## Command-line arguments
182175

183-
You can use command-line arguments for either of the shells, Developer Command Prompt or Developer PowerShell.
176+
You can use command-line arguments for either of the shells: Developer Command Prompt or Developer PowerShell.
184177

185178
### Target Architecture and Host Architecture
186179

187-
For build tools -- like the C++ compiler -- that create outputs targeting specific CPU architectures, the developer shells can be configured using the appropriate command-line argument. The architecture of the build tool binaries can also be configured by using command-line arguments. This is useful when the build machine is a different architecture than the target architecture.
180+
For build tools, like the C++ compiler, that create outputs targeting specific CPU architectures, the developer shells can be configured using the appropriate command-line argument. The architecture of the build tool binaries can also be configured by using command-line arguments. This is useful when the build machine is a different architecture than the target architecture.
188181

189182
> [!TIP]
190-
> Beginning with Visual Studio 2022, `msbuild` will default to a 64-bit msbuild.exe binary, regardless of the Host Architecture.
183+
> Beginning with Visual Studio 2022, `msbuild` defaults to a 64-bit *msbuild.exe* binary, regardless of the Host Architecture.
191184
192185
|Shell|Argument|
193186
|--|--|
@@ -197,7 +190,7 @@ For build tools -- like the C++ compiler -- that create outputs targeting specif
197190
|Developer PowerShell|-HostArch <Host Architecture>|
198191

199192
> [!IMPORTANT]
200-
> Developer PowerShell arguments -Arch and -HostArch are only available beginning with [Visual Studio 2022 version 17.1](/visualstudio/releases/2022/release-notes#1710--visual-studio-2022-version-171-newreleasebutton).
193+
> Developer PowerShell arguments `-Arch` and `-HostArch` are only available beginning with [Visual Studio 2022 version 17.1](/visualstudio/releases/2022/release-notes#1710--visual-studio-2022-version-171-newreleasebutton).
201194
202195
The following table lists which architectures are supported, and whether they can be used for Target Architecture or Host Architecture arguments.
203196

@@ -213,17 +206,20 @@ The following table lists which architectures are supported, and whether they ca
213206
214207
#### Examples
215208

216-
Start the Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target 64-bit:
209+
Start the Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target *64-bit*:
210+
217211
```cmd
218212
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64
219213
```
220214

221-
Start the Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target arm:
215+
Start the Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target *ARM*:
216+
222217
```cmd
223218
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=arm -host_arch=amd64
224219
```
225220

226-
Start the Developer PowerShell for the Community Edition of [Visual Studio 2022 version 17.1](/visualstudio/releases/2022/release-notes#1710--visual-studio-2022-version-171-newreleasebutton) or later on a 64-bit machine, creating build outputs that target arm64:
221+
Start the Developer PowerShell for the Community Edition of [Visual Studio 2022 version 17.1](/visualstudio/releases/2022/release-notes#1710--visual-studio-2022-version-171-newreleasebutton) or later on a 64-bit machine, creating build outputs that target *ARM64*:
222+
227223
```powershell
228224
& 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' -Arch arm64 -HostArch amd64
229225
```
@@ -245,6 +241,6 @@ The Project Location can be adjusted in **Tools** > **Options** > **Projects &am
245241
246242
## Related content
247243

248-
- [Windows Terminal](/windows/terminal/)
249-
- [.NET Framework Tools](/dotnet/framework/tools/index)
244+
- [What is Windows Terminal?](/windows/terminal/)
245+
- [.NET Framework tools](/dotnet/framework/tools/index)
250246
- [Use the Microsoft C++ toolset from the command line](/cpp/build/building-on-the-command-line)

0 commit comments

Comments
 (0)