Skip to content

fix(Chocolatey): 🐛 Add --yess to Install + improve code readability#174

Merged
HeyItsGilbert merged 4 commits into
mainfrom
gs/ChocoYessss
May 16, 2026
Merged

fix(Chocolatey): 🐛 Add --yess to Install + improve code readability#174
HeyItsGilbert merged 4 commits into
mainfrom
gs/ChocoYessss

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Member

@HeyItsGilbert HeyItsGilbert commented May 16, 2026

What this changes

Most important change was to add --yes to choco install.

  • Standardized parameter descriptions in the Get-ChocoInstalledPackage, Get-ChocoLatestPackage, and Invoke-ChocoInstallPackage functions.
  • Enhanced code readability by restructuring command arguments and conditions.
  • Added "lessmsi" to the cspell dictionary for improved spell checking.

Why

If this isn't added, users may not expect to be responding to choco on install. We already prompt for installs and a 2nd prompt isn't needed.

Closes #119

Type of change

  • Bug fix (non-breaking change that corrects incorrect behavior)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Chore / refactor / documentation (no behavior change)

Checklist

  • Pester tests added or updated to cover the change
  • Invoke-psake Analyze passes locally with no new warnings
  • Invoke-psake Test passes locally on at least one platform
  • CHANGELOG.md updated (required for any user-facing change)
  • Documentation updated if behavior changed

Additional notes

* Standardized parameter descriptions in the `Get-ChocoInstalledPackage`, `Get-ChocoLatestPackage`, and `Invoke-ChocoInstallPackage` functions.
* Enhanced code readability by restructuring command arguments and conditions.
* Added "lessmsi" to the cspell dictionary for improved spell checking.
Copilot AI review requested due to automatic review settings May 16, 2026 00:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Chocolatey dependency script to make installs non-interactive and refactors some command construction for readability, with a small spell-check dictionary update.

Changes:

  • Adds --yes to Chocolatey upgrade/install arguments.
  • Refactors Chocolatey command invocations into splatted hashtables.
  • Adds lessmsi to the cspell dictionary.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
PSDepend/PSDependScripts/Chocolatey.ps1 Updates Chocolatey install/list command construction, documentation formatting, and install confirmation behavior.
cspell.json Adds lessmsi as an accepted spelling.
Comments suppressed due to low confidence (1)

PSDepend/PSDependScripts/Chocolatey.ps1:123

  • Using -PassThru as a hashtable value is not a valid switch value in a splat; this should be a Boolean (for example $true) so the script parses and passes the switch correctly.
        PassThru = -PassThru

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PSDepend/PSDependScripts/Chocolatey.ps1 Outdated
Comment thread PSDepend/PSDependScripts/Chocolatey.ps1 Outdated
Comment thread PSDepend/PSDependScripts/Chocolatey.ps1
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 16, 2026

Test Results

    4 files     68 suites   2m 14s ⏱️
1 169 tests 1 081 ✅ 88 💤 0 ❌
1 416 runs  1 326 ✅ 90 💤 0 ❌

Results for commit 016e46d.

♻️ This comment has been updated with latest results.

…ential

* Updated `PassThru` to `$true` for proper command execution.
* Ensured that the provided `$Credential` is used instead of prompting for it.
Regression guard: verifies the suppress-prompt flag survives future
edits to Invoke-ChocoInstallPackage argument list.
…package versions

* Updated verbose output to reflect the actual installed version and the latest version found in the repository.
* Changed `PassThru` parameter to `$true` for consistency in command execution.
@HeyItsGilbert HeyItsGilbert merged commit 06f785d into main May 16, 2026
6 checks passed
@HeyItsGilbert HeyItsGilbert deleted the gs/ChocoYessss branch May 16, 2026 04:38
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

Successfully merging this pull request may close these issues.

Chocolatey Dependency hangs if there should be a prompt.

2 participants