File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,12 @@ if ($Credential) {
84
84
85
85
# Find the latest version of Chocolatey, if a version was not specified
86
86
$NupkgUrl = if (-not $ChocolateyVersion ) {
87
- $QueryString = " ((Id eq 'chocolatey') and (not IsPrerelease)) and IsLatestVersion"
88
- $Query = ' Packages()?$filter={0}' -f [uri ]::EscapeUriString($queryString )
89
- $QueryUrl = ($RepositoryUrl.TrimEnd (' /index.json' ), $Query ) -join ' /'
90
-
91
- [xml ]$result = $webClient.DownloadString ($QueryUrl )
92
- $result.feed.entry.content.src
87
+ $QueryUrl = ($RepositoryUrl.TrimEnd (' /index.json' ), " v3/registration/Chocolatey/index.json" ) -join ' /'
88
+ $Result = $webClient.DownloadString ($QueryUrl ) | ConvertFrom-Json
89
+ $Result.items.items [-1 ].packageContent
93
90
} else {
94
91
# Otherwise, assume the URL
95
- " $ ( $RepositoryUrl.TrimEnd (' /index.json' )) /chocolatey/$ ( $ChocolateyVersion ) "
92
+ " $ ( $RepositoryUrl.TrimEnd (' /index.json' )) /v3/content/ chocolatey/$ ( $ChocolateyVersion ) /chocolatey. $ ( $ChocolateyVersion ) .nupkg "
96
93
}
97
94
98
95
# Download the NUPKG
You can’t perform that action at this time.
0 commit comments