Automatic Visual Studio Update Reboot If Necessary

The patches for CVE-2020-0601, CVE-2020-0605 and CVE-2020-0606 caused a pending reboot on my build servers after updating visual studio.So my hope that the unattended visual studio updater script would be finished has not come true So I added a pending reboot detection: Additionally I wanted some more details in the event log regarding the version being updated and the version after the update. I added a few lines using the FileInfo class.Beside that I stop the build agent service during the update process, so that builds do not fail while MSBuild is not available. So here is the full script:

Updating Visual Studio Installer unattended, last episode, hopefully

I have written about keeping build agents up to date in the past and had issues with the vs_installer updating itself. Now again the latest updates were not deployed.After playing around with procmon and friend I found a way to remove its state, so that the installer thinks is starts from the beginning of time - so there is no update. To do so I delete a few folders before starting the installation. I updated my gist file, but cannot update or comment the VisualStudio developer community page, as the issue is closed.