Open vvuk opened 4 years ago
Oh this is actually even worse. I didn't notice that VsDevCmd.bat calls out to powershell.exe -NoProfile -Command "& {if($PSVersionTable.PSVersion.Major -ge 3){Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\\Microsoft.VisualStudio.DevShell.dll'; Send-VsDevShellTelemetry -NewInstanceType Cmd; }}"
which takes forever and should be happening in the background, but maybe powershell blocks on all children to exit?
Looks like the env var VSCMD_SKIP_SENDTELEMETRY
can be set to something to disable this.
On a system with nothing but Visual Studio 2019 installed, posh-vs adds 1 second (well over 1s on cold start) to powershell startup. It invokes VsDevCmd.bat which in turn spawns a ton of cmd.exe processes just to call reg.exe. This is almost entirely the fault of vsdevcmd, but it would be nice to.. just do something better :| Perhaps pull in the common setup into this module itself (making direct calls to query the registry instead of going through reg.exe), and only call vsdevcmd if explicitly asked to import the more exact user environment.