Created
March 26, 2018 15:00
-
-
Save bjh1977/3e1cdac2ce8e60d3d7ab06f2b61069f5 to your computer and use it in GitHub Desktop.
Install the latest version of Nuget to current user's temp folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$InstallDir = join-path $env:temp 'Nuget' | |
if (Test-Path $InstallDir) { | |
Remove-Item -Path $InstallDir -Recurse -Force | |
} | |
New-Item -Path $InstallDir -ItemType Directory -Force | Out-Null | |
# grab nuget commandline from internet | |
$nugetURL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" | |
Write-Verbose "Downloading nuget from $nugetUrl" | |
$wc = New-Object Net.WebClient | |
$wc.DownloadFile($nugetURL, "$InstallDir\nuget.exe") | |
$NugetFullPath = (Get-ChildItem -Path $InstallDir -Filter "nuget.exe" | Select-Object -ExpandProperty FullName -First 1) | |
Write-Host "Nuget path is $NugetFullPath" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment