Earlier quoted context omitted.
The Build Tools installer first installs the Visual Studio tool to select the workloads you want as well.
Let's say I want to compile a helloworld.cpp with no build tools installed yet. What is the minimal winget command to get everything installed, ready for : cl main.cpp ? Ps: I mean a winget command which does not ask anything, neither in command line, nor GUI ? Totally unattenfed.
To install it all in a single step, and beware I haven't tested this, you're better off downloading and running yourself
vs_buildtools.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools
adding whatever workloads you need.Then you'll need to locate and run vcvarsall.bat to setup the environment, which will require some clever code if you're doing it from PowerShell instead of a .bat, and then you can finally call the compiler.