Closed tristanbarcelon closed 2 years ago
If VS required a reboot it won't show up by default by design. The same is true for vswhere. You can pass -All
to see all instances whether in a launchable state or not, but if it showed up after a reboot then it seems very likely that VS itself needed a reboot and wouldn't have launched until that happens.
If you can reproduce this, I recommend passing Get-VSSetupInstance -All -Prerelease | select InstanceId, DisplayName, State
and see what the State
says. It should say "Complete". If it does and still doesn't show up, please reopen this issue and provide the output of Get-VSSetupInstance -All -Prerelease | select *
.
We have a script which uses winget and custom powershell modules to install tools and visual studio 2019 for a self-hosted Azure Devops build agent. More often than not, Get-VSSetupInstance is unable to detect the newly installed instance of VS2019 if I execute it from the same powershell session used to install VS 2019. If I reboot the machine and re-execute Get-VSSetupInstance, it works. Is there something I am doing wrong? When installing visual studio, I am passing the --norestart parameter as specified here: https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019. The variable $VS2019 is used to calculate path for vsixinstaller.exe which we then use to programmatically download and install VSIX from the marketplace.
This is the powershell snippet we use and without a reboot, $VS2019 variable is $null.