Skip to content

Instantly share code, notes, and snippets.

View rajbos's full-sized avatar

Rob Bos rajbos

View GitHub Profile
@rajbos
rajbos / dotnetToolInstallCheck.ps1
Last active May 17, 2024 01:59
Use dotnet tool to find out if a specific tool is installed on an environment
# Preface:
# dotnet tool install -g will return an error code when the tool is already installed in the system (at the same location)
# adding a test like below, will prevent the error
# this is mostly needed in a CI/CD environment where you don't want to break your pipeline if the tool was installed already.
# find if stryker is installed
$list = (dotnet tool list -g)
# echo the list
# $list