From 8871b3a9c31c77163e40593edf1a83ce0fcff2f7 Mon Sep 17 00:00:00 2001 From: Shubham Gogna <36936863+shgogna@users.noreply.github.com> Date: Mon, 13 Dec 2021 09:40:24 -0800 Subject: [PATCH 1/2] 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 --- TerminalDocs/dynamic-profiles.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/TerminalDocs/dynamic-profiles.md b/TerminalDocs/dynamic-profiles.md index a7be5723..da63ed1a 100644 --- a/TerminalDocs/dynamic-profiles.md +++ b/TerminalDocs/dynamic-profiles.md @@ -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/): @@ -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` From 8527dba7d5bbbc27ba33f2a2cd1a9f05ac6a6567 Mon Sep 17 00:00:00 2001 From: Matt Wojciakowski Date: Mon, 13 Dec 2021 14:18:02 -0800 Subject: [PATCH 2/2] Update VS version info in 3rd party (#462) --- TerminalDocs/dynamic-profiles.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/TerminalDocs/dynamic-profiles.md b/TerminalDocs/dynamic-profiles.md index da63ed1a..93f26070 100644 --- a/TerminalDocs/dynamic-profiles.md +++ b/TerminalDocs/dynamic-profiles.md @@ -138,33 +138,40 @@ 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 2019 +### 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%" } ``` -### Developer Powershell for Visual Studio 2019 +> [!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. -Assuming that you've installed [Visual Studio 2019 Enterprise](https://visualstudio.microsoft.com/downloads/): +### Developer Powershell for Visual Studio + +Assuming that you've installed [Visual Studio](/visualstudio/install/install-visual-studio): ```json { - "name": "Developer Powershell for VS 2019", + "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}\"" } ``` -An easy way to figure out the `commandline` to use for your Visual Studio instance is: +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.