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

Implementation of Get-ChocoInstalledPackage fails when using Chocolatey as a package #87

Closed
lukegriffith opened this issue Jul 10, 2017 · 5 comments
Assignees
Milestone

Comments

@lukegriffith
Copy link
Contributor

The current used implementation considers the choco version banner to be a package, and returns with a version "vX.X.X", if chocolatey is installed via the choco package the list has duplicates, and the presence of the string v causes the where clause, converting the string to a version to fail.

Moving to using the -r argument, and converting from a CSV will resolve these problems, only consideration is how backwards compatible is -r?

Potential simpler implementation.

function Get-ChocoInstalledPackage {

    Return (Choco list -r -l | ConvertFrom-Csv -Header "Name", "Version" -Delimiter "|")
}
@ferventcoder
Copy link
Member

-r or limit output has been available since 0.9.9 (almost 2.5 years now), so there shouldn't be a concern for compat. It should be using -r. Most things for cChoco are going to come up to be more like what you see in the Puppet provider.

@ferventcoder
Copy link
Member

Is this a gating issue for you currently?

@lukegriffith
Copy link
Contributor Author

lukegriffith commented Jul 10, 2017

Not currently, we've forked the hell out of this resource I won't lie. I've fixed our implementation just being a good citizen.

@ferventcoder
Copy link
Member

@lukemgriffith 👍

If it's allowed, we'd love to get some of those fixes into here...

@lukegriffith
Copy link
Contributor Author

submitted PR for this. #88

ferventcoder pushed a commit to ferventcoder/cChoco that referenced this issue Jul 14, 2017
The old implementation caused promotional message, and chocolatey banner to
get mixed into the works. If upgrading Chocolatey, cause problems as the
version caught is a string with "vX.X.X" and in the where clause is attempted
to be converted to a .NET version type.

Limiting the output reduces it to only the packages, leaving out any banners.
ferventcoder added a commit to ferventcoder/cChoco that referenced this issue Jul 14, 2017
* pr88:
  (chocolateyGH-87) Moved to using reduced output
@ferventcoder ferventcoder self-assigned this Jul 14, 2017
ferventcoder added a commit that referenced this issue Aug 29, 2017
* development:
  (GH-71) Implemented cChocoFeature
  (GH-87) Moved to using reduced output
  (maint) formatting
  (GH-70) Apply Apache v2 Licensing
  (GH-85) Pass the source to cChocoPackageInstallerSet correctly
  (GH-44) Pass the Source to choco correctly
  Added version to example
  (GH-77) Push to gallery on new tags
  (maint) formatting
  (GH-72) PowerShell scripts in format for signing
jrdnr added a commit to jrdnr/cChoco that referenced this issue Sep 1, 2017
…ages_for_faster_run

* development:
  (chocolateyGH-87) Moved to using reduced output
  (maint) formatting
  (chocolateyGH-70) Apply Apache v2 Licensing
  (chocolateyGH-85) Pass the source to cChocoPackageInstallerSet correctly
  (chocolateyGH-44) Pass the Source to choco correctly
  Added version to example
  (chocolateyGH-77) Push to gallery on new tags
  (maint) formatting
  (chocolateyGH-72) PowerShell scripts in format for signing

# Conflicts:
#	DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants