-
-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathGet-NuGetTool.ps1
More file actions
22 lines (19 loc) · 723 Bytes
/
Get-NuGetTool.ps1
File metadata and controls
22 lines (19 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<#
.SYNOPSIS
Downloads the NuGet.exe tool and returns the path to it.
.PARAMETER NuGetVersion
The version of the NuGet tool to acquire.
#>
Param(
[Parameter()]
[string]$NuGetVersion='6.4.0'
)
$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1"
$binaryToolsPath = Join-Path $toolsPath $NuGetVersion
if (!(Test-Path $binaryToolsPath)) { $null = mkdir $binaryToolsPath }
$nugetPath = Join-Path $binaryToolsPath nuget.exe
if (!(Test-Path $nugetPath)) {
Write-Host "Downloading nuget.exe $NuGetVersion..." -ForegroundColor Yellow
(New-Object System.Net.WebClient).DownloadFile("https://dist.nuget.org/win-x86-commandline/v$NuGetVersion/NuGet.exe", $nugetPath)
}
return (Resolve-Path $nugetPath).Path