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.

Create a link to a UWP app to run as administrator

I’m a console enthusiast. I used to work with cmder over the last years. In general I was pretty happy. But the announcement of the Windows Terminal really caught my attention.One thing that annoyed me is the disabled checkbox, when creating a link, that does not allow to have it automatically prompt for elevation.So here is my work around. Open windows explorer and enter shell:AppsFolder into the address bar to open the apps folder:Drag‘n’drop the Windows Terminal to any folder.Now patch the lnk-file: Create another lnk file pointing to cmd {path to the first lnk file}, running minimized and having a nice icon.Now just use the second lnk file and it works as expected.Windows Terminal, PowerShell 6 and oh-my-posh up and running.

Scheduled task to automatically delete Fiddler HTTPS interception certificates

I really like Fiddler, the web debugger. I like TLS. I develop software. Therefore I find the interception and decryption of secure traffic very useful.On the other hand I’m into security for a few years now and from that perspective it is a man in the middle attack. So you might want to allow this for the shortest period of time.Fiddler installs a Trusted Root Certificate and dynamically issues certificates for the requested targets for the requested host names. This messes up the certificate store and under certain circumstances leaves risk for potential abuse of these certificates – which are trusted on your machine.So let’s do some automation to clean up. First a few lines of PowerShell:And Finally a scheduled task to import that runs on log on:HTH

Junctions with PowerShell

Junctions are really useful. It pretty easy to create them inside a command shell on windows: But as it is a command inside cmd.exe and not a executable you cannot use mklink from PowerShell without calling cmd.exe BUT: the New-Item cmdlet supports options to achieve the same since Windows Management Framework v.5.

Updating the .NET target framework for many projects

I do component based development. Meaning I have 30+ repos, builds and each of them has 1-10 projects – The main library project, tests, samples and so on. The news about the support end for the .NET Framework 4, 4.5 and 4.5.1 was the motivation to update ALL of my projects. I know this is not neccessary because… .NET 4.5.2, 4.6 and 4.6.1 are compatible, in-place updates on top of .NET 4, .NET 4.5, and .NET 4.5.1. This means that applications built to target any of these previous .NET 4.x versions will continue running on .NET 4.5.2 without change. No recompiling of apps is necessary. ... but I wanted to update them from version 4 to since a long time now. To do the job I wrote a small powershell script. Beside the path command set-frameworkVersion there is CommitAndPush-GitRepositories which commits and pushes all repositories found underneath the path variable.