Skip to content

Commit

Permalink
Sync main > live (#463)
Browse files Browse the repository at this point in the history
* Update dynamic-profiles.md (#438)

* Update dynamic-profiles.md

Create section for dynamic profile for `Developer Powershell for VS 2019`

* Update dynamic-profiles.md

Update name and remove `startingDirectory`

* Update dynamic-profiles.md

Explain a little better

* Update VS version info in 3rd party (#462)

Co-authored-by: Shubham Gogna <36936863+shgogna@users.noreply.github.com>
  • Loading branch information
mattwojo and shgogna authored Dec 13, 2021
1 parent 7555ca9 commit a86679a
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions TerminalDocs/dynamic-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,38 @@ For more details, see the Terminals section of the [MSYS2 documentation](https:/

### Developer Command Prompt for Visual Studio

Assuming that you've installed [Visual Studio 2019 Professional](https://visualstudio.microsoft.com/downloads/):
Assuming that you've installed [Visual Studio](/visualstudio/install/install-visual-studio):

```json
{
"name": "Developer Command Prompt for VS 2019",
"name": "Developer Command Prompt",
"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/Tools/VsDevCmd.bat\"",
"startingDirectory": "%USERPROFILE%"
}
```

> [!NOTE]
> Visual Studio’s “Developer Powershell” and “Developer Command Prompt” include shell environment variables and tools settings that would not be available in the default Command Prompt or Powershell instance.
### Developer Powershell for Visual Studio

Assuming that you've installed [Visual Studio](/visualstudio/install/install-visual-studio):

```json
{
"name": "Developer Powershell",
"commandline": "powershell.exe -noe -c \"&{Import-Module \"\"\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/Microsoft.VisualStudio.DevShell.dll\"\"\"; Enter-VsDevShell 994a9d58}\""
}
```

To find the `commandline` path to use in the Windows Terminal settings for your Visual Studio instance:

1. Find the shortcut to `Developer Powershell for VS 2019` in the start menu
2. Right-click and select `Open File Location`
3. Right-click and select `Properties` on the shortcut
4. Inspect the `Target` field. It will be some value like `C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell 994a9d58}"`
5. Use `Target` field value to update the file path for `Import-Module` in the profile `commandline`
6. Use `Target` field value to update the unique instance ID used with the `Enter-VsDevShell` command in the profile `commandline`

> [!NOTE]
> Visual Studio’s “Developer Powershell” and “Developer Command Prompt” include shell environment variables and tools settings that would not be available in the default Command Prompt or Powershell instance.

0 comments on commit a86679a

Please sign in to comment.