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: