cChoco icon indicating copy to clipboard operation
cChoco copied to clipboard

(GH-61) Validate exit code when installing package

Open orck-adrouin opened this issue 2 years ago • 0 comments

Description

Changes cChocoPackagesInstall to validate choco's exit code. Handles the standard exit codes as documented in Chocolatey's documentation.

This PR is based on pullrequest #103 that has not seen any updates in the last 2 years. Instead of rebasing the PR I cloned the cChoco repo and I copied over (and improved) the changes from the original author.

Related Issue

Fixes #61

Motivation and Context

It allows a DSC to report a failure when Chocolatey fails to install a package.

How Has This Been Tested?

I used the DSC that was provided in issue #61 to simulate an installation failure. Unfortunately, I was not able to find Chocolatey packages to test the different exit codes outlined in this document: https://docs.chocolatey.org/en-us/choco/commands/install#exit-codes .

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

orck-adrouin avatar Jun 08 '22 19:06 orck-adrouin