Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

updating install script to have parameter for chocolatey version. #712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickmcclory
Copy link

I had a client that needed to test multiple versions of chocolatey for validation of their software packages. In the process, it made sense to push this back to the team as it's a pretty basic change. I updated the URL such that it optionally adds a version number to the URI in accordance with the v2 chocolatey.org API. This has the consequence of downloading the latest when the powershell script is run as-is and additionally accepts a parameter of -chocolateyVersion to specify the full version # as specified here: https://chocolatey.org/packages/chocolatey/#versionhistory

$url = "https://chocolatey.org/api/v2/package/chocolatey/"
#$url = "https://chocolatey.org/api/v1/package/chocolatey"
if (![string]::IsNullOrEmpty($chocolateyVersion)){Write-Host "Downloading specific version of Chocolatey: " + $chocolateyVersion}
$url = "https://chocolatey.org/api/v2/package/chocolatey/" + $chocolateyVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks close, but how does it do when there is no version?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants