core-setup/eng/common/darc-init.ps1

33 строки
1.1 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

param (
$darcVersion = $null
)
$verbosity = "m"
2018-10-17 15:40:37 +03:00
. $PSScriptRoot\tools.ps1
2018-10-03 15:20:29 +03:00
function InstallDarcCli ($darcVersion) {
2018-10-17 15:40:37 +03:00
$darcCliPackageName = "microsoft.dotnet.darc"
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
2018-10-17 15:40:37 +03:00
if ($toolList -like "*$darcCliPackageName*") {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
2018-10-17 15:40:37 +03:00
}
# Until we can anonymously query the BAR API for the latest arcade-services
# build applied to the PROD channel, this is hardcoded.
if (-not $darcVersion) {
$darcVersion = '1.1.0-beta.19120.2'
}
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
2018-10-17 15:40:37 +03:00
Write-Host "Installing Darc CLI version $darcVersion..."
2018-10-17 15:40:37 +03:00
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
2018-10-17 15:40:37 +03:00
}
InstallDarcCli $darcVersion