Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Created May 18, 2012 00:34
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 Iristyle/2722455 to your computer and use it in GitHub Desktop.
Save Iristyle/2722455 to your computer and use it in GitHub Desktop.
Powershell Nuget Bootstrap
param([string] $destination = "$(Get-Location)")
$client = New-Object System.Net.WebClient
$results = [xml]$client.DownloadString('http://packages.nuget.org/v1/FeedService.svc/Packages()?$filter=Id eq ''NuGet.CommandLine''&$orderby=Published desc&$top=1')
$path = "${Env:Temp}\nuget.zip"
$client.DownloadFile($location.feed.entry.content.src, $path)
$shellApplication = New-Object -com Shell.Application
$zipItems = $shellApplication.NameSpace($path).Items()
$extracted = "${Env:temp}\nuget"
if (!(test-path $extracted)) { [Void](New-Item $extracted -type directory) }
$shellApplication.NameSpace($extracted).CopyHere($zipItems, 0x14)
if (!(test-path $destination)) { [Void](New-Item $destination -type directory) }
Copy-Item "$extracted\tools\NuGet.exe" $destination
Remove-Item $extracted -Recurse
Remove-Item $path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment