Skip to content

Instantly share code, notes, and snippets.

@patriksvensson
Created September 15, 2016 09:38
Show Gist options
  • Save patriksvensson/59b83c9afaf0b2cc12a729f1cf7d89be to your computer and use it in GitHub Desktop.
Save patriksvensson/59b83c9afaf0b2cc12a729f1cf7d89be to your computer and use it in GitHub Desktop.
Download NuGet package
Function Get-NuGetPackage(
[string]$Source = "http://nuget.org",
[string]$Package,
[string]$Version)
{
$Url = "$Source/api/v2/package/$Package/$Version"
$Output = Join-Path (Get-Location) "$Package.$Version.nupkg"
(New-Object System.Net.WebClient).DownloadFile($Url, $Output)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment