dotnet-installer/eng/common/darc-init.ps1

33 lines
1.1 KiB
PowerShell
Raw Normal View History

param (
$darcVersion = $null
)
2018-10-22 05:07:26 +00:00
$verbosity = "m"
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
2018-10-22 05:07:26 +00:00
$darcCliPackageName = "microsoft.dotnet.darc"
2018-12-19 20:55:42 +00:00
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
2018-11-08 01:51:56 +00:00
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
2018-10-22 05:07:26 +00:00
if ($toolList -like "*$darcCliPackageName*") {
2018-11-08 01:51:56 +00:00
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
2018-10-22 05:07:26 +00: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.19175.6'
}
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
2018-10-22 05:07:26 +00:00
Write-Host "Installing Darc CLI version $darcVersion..."
2018-10-22 05:07:26 +00: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-22 05:07:26 +00:00
}
InstallDarcCli $darcVersion