11param (
22 $darcVersion = $null ,
3- $versionEndpoint = " https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16" ,
4- $verbosity = " m"
3+ $versionEndpoint = ' https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' ,
4+ $verbosity = ' minimal' ,
5+ $toolpath = $null
56)
67
78. $PSScriptRoot \tools.ps1
89
9- function InstallDarcCli ($darcVersion ) {
10- $darcCliPackageName = " microsoft.dotnet.darc"
10+ function InstallDarcCli ($darcVersion , $toolpath ) {
11+ $darcCliPackageName = ' microsoft.dotnet.darc'
1112
1213 $dotnetRoot = InitializeDotNetCli - install:$true
1314 $dotnet = " $dotnetRoot \dotnet.exe"
@@ -23,11 +24,24 @@ function InstallDarcCli ($darcVersion) {
2324 $darcVersion = $ (Invoke-WebRequest - Uri $versionEndpoint - UseBasicParsing).Content
2425 }
2526
26- $arcadeServicesSource = ' https://dotnetfeed.blob.core.windows.net/ dotnet-core /index.json'
27+ $arcadeServicesSource = ' https://pkgs.dev.azure.com/dnceng/public/_packaging/ dotnet-eng/nuget/v3 /index.json'
2728
2829 Write-Host " Installing Darc CLI version $darcVersion ..."
29- Write-Host " You may need to restart your command window if this is the first dotnet tool you have installed."
30- & " $dotnet " tool install $darcCliPackageName -- version $darcVersion -- add-source " $arcadeServicesSource " - v $verbosity - g -- framework netcoreapp2.1
30+ Write-Host ' You may need to restart your command window if this is the first dotnet tool you have installed.'
31+ if (-not $toolpath ) {
32+ Write-Host " '$dotnet ' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource ' -v $verbosity -g"
33+ & " $dotnet " tool install $darcCliPackageName -- version $darcVersion -- add-source " $arcadeServicesSource " - v $verbosity - g
34+ }else {
35+ Write-Host " '$dotnet ' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource ' -v $verbosity --tool-path '$toolpath '"
36+ & " $dotnet " tool install $darcCliPackageName -- version $darcVersion -- add-source " $arcadeServicesSource " - v $verbosity -- tool- path " $toolpath "
37+ }
3138}
3239
33- InstallDarcCli $darcVersion
40+ try {
41+ InstallDarcCli $darcVersion $toolpath
42+ }
43+ catch {
44+ Write-Host $_.ScriptStackTrace
45+ Write-PipelineTelemetryError - Category ' Darc' - Message $_
46+ ExitWithExitCode 1
47+ }
0 commit comments