Developer PowerShell for VS2022 in the terminal tab.

已回答

In Settings -> Tools -> Terminal, the Shell Path lets you specify PowerShell, but for the Terminal to have all the environmental variables, path and setup included in the Developer PowerShell for VS2022, the command line needs to be:

"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" -noe -c "&{Import-Module """C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell 631d44f4}"

This works in a normal command window, but not in the "Shell Path". It results in a standard PowerShell.exe without importing the DevShell module. There are examples of parameters being used in this field, but this second command of Import-Module is beyond its capability. How can I make the Terminal tab be a Developer PowerShell for VS2022?

0

Hi Frederick,

This sounds like the recent issue https://youtrack.jetbrains.com/issue/IDEA-327666

The problem was fixed, and the fix will be included in version 2023.2.2 of IntelliJ IDEA to be released on September 5th.

1

Sounds great. When might that fix come out for CLion?

0

September 7th if all goes as planned.

1

Sound great. Thank you. FYI, a slightly updated Shell path might be:

"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" -noe -c "&{Import-Module """C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -Arch amd64 -HostArch amd64}"

Where $installPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath

Although you might be able to leave out -VsInstallPath $installPath. Haven't tried that.

Can you set up variables such as the $installPath, in another part of CLion, that could then be used in the Shell path field?

0
Thanks for the suggestion Frederick.

I created a new feature request for it in our tracking system: https://youtrack.jetbrains.com/issue/IDEA-331177

You are welcome to upvote it and leave additional comments / suggestions there.
0

请先登录再写评论。