chocolatey / chocolatey/ChocoCCM
Fix PSSA rule violation in New-CcmDeploymentStep
- Dominant language
- PowerShell
- Stars
- 7
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
### What You Are Seeing?
This parameter declaration breaks the PSSA rule `PSAvoidDefaultValueSwitchParameter` because the switch defaults to `$true`:
https://github.com/chocolatey/ChocoCCM/blob/2c92049ff1cbfafe4388cf4bb5105eec3083c808/src/Public/New-CCMDeploymentStep.ps1#L110-L112
### What is Expected?
Switch parameters should never default to $true in PowerShell as it is cumbersome and counterintuitive to set them to $false when needed.
I suggest renaming the switch to `-ContinueOnError` instead, so that the ordinary and expected default of `$false` for a switch parameter behaves as expected. We will then need to invert the value before passing it to CCM.
### How Did You Get This To Happen? (Steps to Reproduce)
I opened the file for editing in VS Code with the PowerShell extension enabled.
### System Details
N/A
### Output Log
N/A
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/Public/New-CCMDeploymentStep.ps1 at the parameter declaration around lines 110-112, then inspect how that parameter is passed to CCM. Rename the switch as proposed and verify the default behavior and PSSA compliance, including any relevant module tests if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100