chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
154 stars 99 forks source link

Add test-path handler to cChocoPackageInstall in case of missing ChocoInstalled.xml #177

Closed BCOps closed 5 months ago

BCOps commented 1 year ago

Description Of Changes

cChocoPackageInstall Get-ChocoInstalledPackage has been updated to test for the presence of ChocoInstalled.xml before trying to delete it when purge is set to true, avoiding a breaking error if it is not located.

Motivation and Context

Fixes #160

Testing

  1. Validated on Windows Server 2019 by creating local cChoco DSC module at new version with applied changes. Resource specified was uninstalled and reinstalled at specific verison (as per report in issue #160 ) with graceful handling of the missing ChocoInstalled.xml file. File was not detected, remove-item was skipped, and module run completed successfully.

    Operating Systems Testing

    • Windows Server 2019 Core
    • Windows Server 2016

Change Types Made

Change Checklist

Related Issue

Fixes #160

BCOps commented 1 year ago

Appveyor tests are showing as passing

corbob commented 1 year ago

I just had a bit of a perusal over #103. If I understand this PR correctly, I suspect it took inspiration from that PR? Instead of the Invoke-Chocolatey and Invoke-ChocolateyProcess, we might want to consider using Invoke-Choco from the Chocolatey Pester tests here. Although maybe not returning or logging as much as there as it's not likely needed in the DSC context.

AF250329 commented 5 months ago

Is there any news about this Pull Request ? Is it gonna be merged ?

pauby commented 5 months ago

@AF250329 This PR is waiting on a response to the last comment by @corbob.