Skip to content

Update dynamic-profiles.md #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion TerminalDocs/dynamic-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Assuming that you've installed MSYS2 into `C:\\msys64`:

For more details, see the Terminals section of the [MSYS2 documentation](https://www.msys2.org/docs/terminals/#windows-terminal).

### Developer Command Prompt for Visual Studio
### Developer Command Prompt for Visual Studio 2019

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

Expand All @@ -149,3 +149,22 @@ Assuming that you've installed [Visual Studio 2019 Professional](https://visuals
"startingDirectory": "%USERPROFILE%"
}
```

### Developer Powershell for Visual Studio 2019

Assuming that you've installed [Visual Studio 2019 Enterprise](https://visualstudio.microsoft.com/downloads/):

```json
{
"name": "Developer Powershell for VS 2019",
"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}\""
}
```

An easy way to figure out the `commandline` to use for your Visual Studio instance is:
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`