Created
May 18, 2012 00:34
-
-
Save Iristyle/2722455 to your computer and use it in GitHub Desktop.
Powershell Nuget Bootstrap
This file contains hidden or 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
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