Automatically Updating Visual Studio Overnight
A while back I ran across the dotnet-vs project by Kzu. It’s a super handy set of tools for VS from the CLI.
I noticed it had an update
command which led me to immediately see if I can have use it to automatically update Visual Studio overnight.
Here’s how I set it up:
- Install dotnet-vs using the following command on the terminal:
dotnet tool update -g dotnet-vs
- Open up Task Scheduler and create a new Task.
- Enable the following two options:
- Run only when user is logged on
- Run with highest privileges
- Add a Trigger so the task runs early each morning.
- Add an Action to run
dotnet-vs
- Set Program/script by browsing to
%USERPROFILE%\.dotnet\tools\vs.exe
- Set Add arguments to
update all
- Set Program/script by browsing to
That’s all I needed to do to start each day with the latest bits installed. Even if I leave Visual Studio running overnight, the installer will gracefully close and reopen it after the update. It’s worked really well for me.
Finally, this isn’t something I’d say is officially supported. It’s just something I tried and found to work. YMMV, but I hope it helps.