In a Azure Devop Build, I’m using a tool(https://github.com/tomchavakis/nuget-license). I want this tool to be installed in my Azure Devop Agent.
I’ve created this task in my YML:
- task: CmdLine@2
displayName: 'Install dotnet-project-licenses'
inputs:
script: 'dotnet tool install dotnet-project-licenses -g'
This works, but only the first time. Then when the tool is already installed, I get an error code.
So how to install this automatically on my agents once? Or swallow the error?
2
Answers
Try running the script as
If the tool isn’t installed this command should install it, and if it is already installed it shouldn’t give an error
You can add a powershell task instead of the cmd and add the continue on error action. Then your pipeline will continue if it is already installed.