Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Get-nbgv.ps1 « azure-pipelines - github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a5be2cf7cd713b7e6e81af9b20d61dfdbe5226f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<#
.SYNOPSIS
    Gets the path to the nbgv CLI tool, installing it if necessary.
#>
Param(
)

$existingTool = Get-Command "nbgv" -ErrorAction SilentlyContinue
if ($existingTool) {
    return $existingTool.Path
}

$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1"

$toolPath = "$toolInstallDir/nbgv"
if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null }

if (!(Get-Command $toolPath -ErrorAction SilentlyContinue)) {
    Write-Host "Installing nbgv to $toolInstallDir"
    dotnet tool install --tool-path "$toolInstallDir" nbgv --configfile "$PSScriptRoot/justnugetorg.nuget.config" | Out-Null
}

# Normalize the path on the way out.
return (Get-Command $toolPath).Path