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

chocolateyfeature should set setExplicitly to true #360

Open
brajjan opened this issue Sep 20, 2024 · 0 comments
Open

chocolateyfeature should set setExplicitly to true #360

brajjan opened this issue Sep 20, 2024 · 0 comments

Comments

@brajjan
Copy link

brajjan commented Sep 20, 2024

Use Case

When changing a chocolateyfeature to enabled it only sets the "enabled" property to "true" (this is how chocolatey defines its default values) and does not care about the "setExplicitly" property.

eg.

chocolateyfeature { 'exitOnRebootDetected':
  ensure => 'enabled',
}

Notice: /Stage[main]/Main/Chocolateyfeature[exitOnRebootDetected]/ensure: ensure changed 'disabled' to 'enabled'

PS> Get-Content C:\ProgramData\chocolatey\config\chocolatey.config | Select-String exitOnRebootDetected

<feature name="exitOnRebootDetected" enabled="true" setExplicitly="false" description="Exit On Reboot Detected - Stop running install, upgrade, or uninstall when a reboot request is detected. Requires 'usePackageExitCodes' feature to be turned on. Will exit with either 350 or 1604. When it exits with 350, it
means pending reboot discovered prior to running operation. When it exits with 1604, it means some work completed prior to reboot request being detected." />

Describe the Solution You Would Like

When setting a chocolateyfeature to "enabled" it should care about and set the setExplicitly value to true aswell

Additional Context

This could be addressed by having the chocolateyfeature provider also look at / change the setExplicitly
Will make a PR for this aswell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant