Adrien Clerbois' blog

Software Craftmanship @ Sense Of Tech, Microsoft MVP Developer Technologies

Update all dotnet tools on one command

To be a developer is to be lazy. I often use the dotnet global tools set up in the dotnet cli.

Unfortunately, to date there is no : “dotnet tool update --all” command to be able to update all the packages at the same time. Here is the powershell command that I use to update all of them while lying in its seat:

foreach ($packageToUpdate in $(dotnet tool list --global | Select-Object -Skip 2)) {
    Write-Host "dotnet tool update --global $($packageToUpdate.Split(" ", 2)[0])"
    dotnet tool update --global $($packageToUpdate.Split(" ", 2)[0])
}