chocolatey / cChoco

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

(GH-61) Validate exit code when installing package #168

Open orck-adrouin opened 2 years ago

orck-adrouin commented 2 years ago

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

Checklist: