Created
November 30, 2015 19:32
-
-
Save ferventcoder/8af7b9100ccccf405a8f to your computer and use it in GitHub Desktop.
Get Latest Version of Chocolatey from a NuGet OData Endpoint
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
$versionUrl = 'http://[NuGetEndpoint]/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion' | |
$downloader = new-object System.Net.WebClient | |
$downloader.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials; | |
Write-Output "Querying latest package from $url" | |
[xml]$pkg = $downloader.DownloadString($versionUrl) | |
$latestPackageVersionUrl = $pkg.feed.entry.content.src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment