Skip to content

Instantly share code, notes, and snippets.

@dphoebus
Forked from tillig/Install-DotnetCliTools.ps1
Created November 7, 2023 15:58
Show Gist options
  • Save dphoebus/4d5b3702074c35a5db4d219edf7d829f to your computer and use it in GitHub Desktop.
Save dphoebus/4d5b3702074c35a5db4d219edf7d829f to your computer and use it in GitHub Desktop.
PowerShell script for installing/updating my dotnet CLI global tools
# Tool lists:
# https://github.com/aspnet/AspNetCore/blob/master/src/Tools/
# https://github.com/natemcmaster/dotnet-tools
$tools = @(
'dotnet-counters',
'dotnet-depends',
'dotnet-dump',
'dotnet-format',
'dotnet-guid',
'dotnet-outdated-tool',
'dotnet-script',
'dotnet-svcutil',
'dotnet-symbol',
'dotnet-trace',
'dotnetsdkhelpers',
'gti',
'microsoft.web.librarymanager.cli')
foreach($tool in $tools) {
# Install if it doesn't exist
&dotnet tool install -g $tool
if($LastExitCode -eq 0) {
continue
}
# Upgrade if it was already installed
&dotnet tool update -g $tool
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment