Closed genio closed 4 months ago
You can start the "Developer Command Prompt" in either cmd.exe or pwsh.exe/powershell.exe (whichever is found first) from the shortcuts installed with VS. This module is used to get metadata for every VS instance installed and is likely not what you're looking for.
Long ago I also added support to Windows Terminal directly to find instances, so you can also find profiles already in WT (just disabled by default, but you can easily enable them).
In either case, you just start it and have a shell ready.
Again, those start things for 32-bit builds. sigh
See https://learn.microsoft.com/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022. You can use these cmdlets (though you're using vswhere
, which also works, but is a different repo: https://github.com/microsoft/vswhere) to find that and launch it:
$vs = Get-VSSetupInstance -Prerelease | Select-VSSetupInstance -Latest
& "$(Join-Path $vs.InstallationPath Common7\Tools\Launch-VsDevShell.ps1)" -Arch amd64
In Windows Terminal, you can modify the profiles to suit your needs. vswhere
and these cmdlets are only for finding VS instances. If you would like to suggest changes to the shortcuts, I recommend filing feedback through Visual Studio so it gets to the right team.
This doesn't help load a dev environment in the current shell... at all!
Loading the default developer powershell environment loads as if I want to build 32-bit things on a 64-bit machine. The insanity that is required to actually load a proper dev environment in Windows is baffling.
Is there really no better way than to write something akin to:
Even all of that nonsense assumes lots of things and doesn't "Just work". On MacOS, it's one command. On Linux, it's one command. On Windows, it's "yeah.... good luck". WHY?!?