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

[2.4.0.0] cChocoPackageInstaller: Test-TargetResource always $false with custom source #135

Closed
bozho opened this issue Jan 3, 2020 · 0 comments

Comments

@bozho
Copy link
Contributor

bozho commented Jan 3, 2020

There was a change in Test-TargetResource when passing a custom source to Test-LatestVersionInstalled

Previously, the code was:

        if ($AutoUpgrade -and $isInstalled) {
            $result = Test-LatestVersionInstalled -pName $Name -pSource $Source
        } else {
            $result = $isInstalled
        }

Current code it (line 167 in cChocoPackageInstall.psm1):

        if ($AutoUpgrade -and $isInstalled) {
            if ($Source){
                [string]$pSource = "-pSource `"$Source`""
            }
            $result = Test-LatestVersionInstalled -pName $Name $pSource
        } else {
            $result = $isInstalled
        }

which results in choco being executed as:

choco upgrade <package> --noop --source="-pSource "<custom_source>""
bozho added a commit to bozho/cChoco that referenced this issue Jan 3, 2020
pauby added a commit that referenced this issue Feb 26, 2020
[#135] A fix for passing custom source name in cChocoPackageInstaller…
@pauby pauby closed this as completed Feb 26, 2020
pauby added a commit that referenced this issue Feb 26, 2020
* development:
  [#135] A fix for passing custom source name in cChocoPackageInstaller Test-TargetResource
  (maint) Fix description and issue label
  (maint) Fix headings
  (GH-126) Document WinRM envelope size issue
  Corrected reversed logic in `if (-not $Purge) Using `$Purge.IsPresent` to be more explicit.
  Revered if Purge.IsPresent checks back to origional order
  Converted simple functions to "Advanced Functions" to match the rest of code
  (maint) Add build instructions
  (maint) Formatting
  Updated [Version] to Fully Qualified [System.Version]
  Choco appends '-beta' to beta version numbers Added parsing to split on '-' and only use the first section.
  Implemented caching choco version Ensured explicitly casting '0.10.4' to Version
  Powershell cannot compair 0.10.4 to a version number
  Fix Pester Test run Failure
  Choco Versions >10.4 overwhelm log with download Progress data
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

2 participants