Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choco --version includes warnings, breaks version parsing #1562

Closed
mrhockeymonkey opened this issue May 8, 2018 · 2 comments
Closed

choco --version includes warnings, breaks version parsing #1562

mrhockeymonkey opened this issue May 8, 2018 · 2 comments

Comments

@mrhockeymonkey
Copy link

What You Are Seeing?

We use choco --version to parse the version of chocolatey that is running. However currently due to an expired licence a warning is also displayed that is stopping us from parsing the version. We then thought we could use the file version of the choco.exe itself but there was a mismatch.

choco -v
A license was found for a licensed version of Chocolatey, but is invalid:
 Expiration Date : 00/00/0000 00:00:00
0.10.8

(gi C:\ProgramData\chocolatey\bin\choco.exe).versioninfo.fileversion
0.10.5.0

What is Expected?

a) the file version should match the version choco.exe claims to be
b) when running choco --version the only output should be the version. suppress all warnings and other output

Note the license isn't the issue here we are in the process of updating it but we now have to add a fix for this unexpected output. Not a huge issues nor a priority but it would be nice for future implementations to be able to trust this command.

@gep13
Copy link
Member

gep13 commented May 8, 2018

@mrhockeymonkey for now, you should be able to use:

(Get-Item C:\ProgramData\chocolatey\choco.exe).versioninfo.fileversion

The choco.exe in the other location is actually a shim to the actual exe (although it should have the same version number I believe).

@ferventcoder
Copy link
Member

This is completed for Chocolatey v0.10.12.

ferventcoder added a commit that referenced this issue Mar 12, 2019
When asking for the version of Chocolatey that is installed, the only
output should be is the version. This breaks things that would use that
information for version parsing.
ferventcoder added a commit that referenced this issue Mar 12, 2019
* stable:
  (GH-1562) Fix: --version includes warnings/errors
  (GH-1724) search - exit 1 on no results
  (GH-1614) Fix: quote if pipe found in string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants