Skip to content

Instantly share code, notes, and snippets.

@idiotandrobot
Created April 18, 2020 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idiotandrobot/c0db42842d0a6972f90fc43423aaca1c to your computer and use it in GitHub Desktop.
Save idiotandrobot/c0db42842d0a6972f90fc43423aaca1c to your computer and use it in GitHub Desktop.
if (Test-Path "nuget.exe") {
Invoke-Expression "./nuget restore"
}
elseif((Get-Command "nuget" -ErrorAction SilentlyContinue) -ne $null) {
nuget restore
}
else {
"Nuget was not found and is required to run bootstrap.ps1. Download and retry now?"
choice /c yn
if ($LASTEXITCODE -eq 1) {
"Downloading nuget..."
$nugetLocation = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
(New-Object Net.WebClient).DownloadFile($nugetLocation, "$PSScriptRoot\nuget.exe")
Invoke-Expression "./nuget restore"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment