3 $versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
7 . $PSScriptRoot\tools
.ps1
9 function InstallDarcCli
($darcVersion) {
10 $darcCliPackageName = "microsoft.dotnet.darc"
12 $dotnetRoot = InitializeDotNetCli
-install
:$true
13 $dotnet = "$dotnetRoot\dotnet.exe"
14 $toolList = Invoke-Expression "& `"$dotnet`
" tool list -g"
16 if ($toolList -like
"*$darcCliPackageName*") {
17 Invoke-Expression "& `"$dotnet`
" tool uninstall $darcCliPackageName -g"
20 # If the user didn't explicitly specify the darc version,
21 # query the Maestro API for the correct version of darc to install.
22 if (-not
$darcVersion) {
23 $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing)
.Content
26 $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
28 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 Invoke-Expression "& `"$dotnet`
" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
33 InstallDarcCli
$darcVersion