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

Add ability to get status of an individual feature (choco feature get) #2815

Closed
jpluimers opened this issue Sep 15, 2022 · 1 comment · Fixed by #2876
Closed

Add ability to get status of an individual feature (choco feature get) #2815

jpluimers opened this issue Sep 15, 2022 · 1 comment · Fixed by #2876

Comments

@jpluimers
Copy link

Is Your Feature Request Related To A Problem? Please describe.

I wanted to know the status of the useRememberedArgumentsForUpgrades feature but found no way to query the status of a single feature.

The only way is to perform a choco feature list (which gets you a list not sorted by feature name, see #2814) and search the output from top to bottom for the feature name.

Describe The Solution. Why is it needed?

It would be really helpful to have a choco feature that queries a feature status by feature name similar to how choco feature disable -n=bob and choco feature enable -n=bob can be used for disabling or enabling a single feature.

Additional Context.

I tried choco feature useRememberedArgumentsForUpgrades just to test if that would work, but it gives the same output as choco feature list on my system: the list is long and I find it hard to search for a single feature (yes, I need to reboot, but also not to forget posting this issue):

Chocolatey v1.1.0
2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).

Validation Warnings:
 - A pending system reboot request has been detected, however, this is
   being ignored due to the current command being used 'feature'.
   It is recommended that you reboot at your earliest convenience.

[x] checksumFiles - Checksum files when pulled in from internet (based on package).
[x] autoUninstaller - Uninstall from programs and features without requiring an explicit uninstall script.
[ ] allowGlobalConfirmation - Prompt for confirmation in scripts or bypass.
[ ] failOnAutoUninstaller - Fail if automatic uninstaller fails.
[ ] failOnStandardError - Fail if install provider writes to stderr. Not recommended for use. Available in 0.9.10+.
[ ] allowEmptyChecksums - Allow packages to have empty/missing checksums for downloaded resources from non-secure locations (HTTP, FTP). Enabling is not recommended if using sources that download resources from the internet. Available in 0.10.0+.
[x] allowEmptyChecksumsSecure - Allow packages to have empty/missing checksums for downloaded resources from secure locations (HTTPS). Available in 0.10.0+.
[x] powershellHost - Use Chocolatey's built-in PowerShell host. Available in 0.9.10+.
[ ] logEnvironmentValues - Log Environment Values - will log values of environment before and after install (could disclose sensitive data). Available in 0.9.10+.
[ ] virusCheck - Virus Check - perform virus checking on downloaded files. Available in 0.9.10+. Licensed versions only.
[ ] failOnInvalidOrMissingLicense - Fail On Invalid Or Missing License - allows knowing when a license is expired or not applied to a machine. Available in 0.9.10+.
[x] ignoreInvalidOptionsSwitches - Ignore Invalid Options/Switches - If a switch or option is passed that is not recognized, should choco fail? Available in 0.9.10+.
[x] usePackageExitCodes - Use Package Exit Codes - Package scripts can provide exit codes. With this on, package exit codes will be what choco uses for exit when non-zero (this value can come from a dependency package). Chocolatey defines valid exit codes as 0, 1605, 1614, 1641, 3010. With this feature off, choco will exit with 0, 1, or -1 (matching previous behavior). Available in 0.9.10+.
[ ] useEnhancedExitCodes - Use Enhanced Exit Codes - Chocolatey is able to provide enhanced exit codes surrounding list, search, info, outdated and other commands that don't deal directly with package operations. To see enhanced exit codes and their meanings, please run `choco [cmdname] -?`. With this feature off, choco will exit with 0, 1, or -1  (matching previous behavior). Available in 0.10.12+.
[ ] exitOnRebootDetected - 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. Available in 0.10.12+.
[ ] useFipsCompliantChecksums - Use FIPS Compliant Checksums - Ensure checksumming done by choco uses FIPS compliant algorithms. Not recommended unless required by FIPS Mode. Enabling on an existing installation could have unintended consequences related to upgrades/uninstalls. Available in 0.9.10+.
[x] showNonElevatedWarnings - Show Non-Elevated Warnings - Display non-elevated warnings. Available in 0.10.4+.
[x] showDownloadProgress - Show Download Progress - Show download progress percentages in the CLI. Available in 0.10.4+.
[ ] stopOnFirstPackageFailure - Stop On First Package Failure - Stop running install, upgrade or uninstall on first package failure instead of continuing with others. As this will affect upgrade all, it is normally recommended to leave this off. Available in 0.10.4+.
[ ] useRememberedArgumentsForUpgrades - Use Remembered Arguments For Upgrades - When running upgrades, use arguments for upgrade that were used for installation ('remembered'). This is helpful when running upgrade for all packages. Available in 0.10.4+. This is considered in preview for 0.10.4 and will be flipped to on by default in a future release.
[ ] ignoreUnfoundPackagesOnUpgradeOutdated - Ignore Unfound Packages On Upgrade Outdated - When checking outdated or upgrades, if a package is not found against sources specified, don't report the package at all. Available in 0.10.9+.
[ ] skipPackageUpgradesWhenNotInstalled - Skip Packages Not Installed During Upgrade - if a package is not installed, do not install it during the upgrade process. Available in 0.10.12+.
[ ] removePackageInformationOnUninstall - Remove Stored Package Information On Uninstall - When a package is uninstalled, should the stored package information also be removed?  Available in 0.10.9+.
[ ] logWithoutColor - Log without color - Do not show colorization in logging output. Available in 0.10.9+.
[x] logValidationResultsOnWarnings - Log validation results on warnings - Should the validation results be logged if there are warnings? Available in 0.10.12+.
[x] usePackageRepositoryOptimizations - Use Package Repository Optimizations - Turn on optimizations for reducing bandwidth with repository queries during package install/upgrade/outdated operations. Should generally be left enabled, unless a repository needs to support older methods of query. When disabled, this makes queries similar to the way they were done in Chocolatey v0.10.11 and before. Available in 0.10.14+.
[ ] scriptsCheckLastExitCode - Scripts Check $LastExitCode (external commands) - Leave this off unless you absolutely need it while you fix your package scripts  to use `throw 'error message'` or `Set-PowerShellExitCode #` instead of `exit #`. This behavior started in 0.9.10 and produced hard to find bugs. If the last external process exits successfully but with an exit code of not zero, this could cause hard to detect package failures. Available in 0.10.3+. Will be removed in 0.11.0.
[ ] disableCompatibilityChecks - Disable Compatibility Checks - Should a warning we shown, before and after command execution, when a runtime compatibility check determines that there is an incompatibility between Chocolatey and Chocolatey Licensed Extension. Available in 1.1.0+

Related Issues

Tom-V added a commit to Tom-V/choco that referenced this issue Oct 29, 2022
@gep13 gep13 added this to the 2.0.0 milestone Jan 19, 2023
gep13 pushed a commit to Tom-V/choco that referenced this issue Apr 13, 2023
@gep13 gep13 changed the title Please amend choco feature with a verb to query a the status of a single feature name Add ability to get status of an individual feature (choco feature get) Apr 14, 2023
gep13 added a commit to Tom-V/choco that referenced this issue Apr 14, 2023
In addition to being able to get the complete list of features on the
system, it should be possible to get the status of a specific feature.
This matches what is possible for example with the choco config get
command.

This commit adds the ability to use choco feature get to get the
current Enabled/Disabled status for a given feature.  If the feature
name provided doesn't exist an error will be returned.

Co-authored-by: Tom Vervoort <[email protected]>
gep13 added a commit to Tom-V/choco that referenced this issue Apr 14, 2023
This commit adds new end to end tests for the new choco feature get
command so ensure that it works as expected. This includes running both
choco feature and choco features, as well as running with --name and
without.
gep13 added a commit to Tom-V/choco that referenced this issue Apr 14, 2023
In addition to being able to get the complete list of features on the
system, it should be possible to get the status of a specific feature.
This matches what is possible for example with the choco config get
command.

This commit adds the ability to use choco feature get to get the
current Enabled/Disabled status for a given feature.  If the feature
name provided doesn't exist an error will be returned.

Co-authored-by: Tom Vervoort <[email protected]>
gep13 added a commit to Tom-V/choco that referenced this issue Apr 14, 2023
This commit adds new end to end tests for the new choco feature get
command so ensure that it works as expected. This includes running both
choco feature and choco features, as well as running with --name and
without.
gep13 added a commit to Tom-V/choco that referenced this issue Apr 14, 2023
This commit adds new end to end tests for the new choco feature get
command so ensure that it works as expected. This includes running both
choco feature and choco features, as well as running with --name and
without.
corbob added a commit that referenced this issue Apr 14, 2023
@corbob corbob closed this as completed Apr 14, 2023
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

gep13 added a commit that referenced this issue May 22, 2024
This was missed when the ability to do choco feature get was added to
Chocolatey CLI v2.0.0.

This commit adds the sub-command, as it is missing when additional
Pester tests are being created as part of the next release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants