-
Notifications
You must be signed in to change notification settings - Fork 11
Fix PSSA rule violation in New-CcmDeploymentStep #64
Copy link
Copy link
Open
Labels
0 - BacklogIssue is accepted, but is not ready to be worked on or not in current sprint.Issue is accepted, but is not ready to be worked on or not in current sprint.BugIssues where something has happened which was not expected or intended.Issues where something has happened which was not expected or intended.Up For GrabsIssues that are available by the community to work on.Issues that are available by the community to work on.
Milestone
Metadata
Metadata
Assignees
Labels
0 - BacklogIssue is accepted, but is not ready to be worked on or not in current sprint.Issue is accepted, but is not ready to be worked on or not in current sprint.BugIssues where something has happened which was not expected or intended.Issues where something has happened which was not expected or intended.Up For GrabsIssues that are available by the community to work on.Issues that are available by the community to work on.
What You Are Seeing?
This parameter declaration breaks the PSSA rule
PSAvoidDefaultValueSwitchParameterbecause the switch defaults to$true:ChocoCCM/src/Public/New-CCMDeploymentStep.ps1
Lines 110 to 112 in 2c92049
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
-ContinueOnErrorinstead, so that the ordinary and expected default of$falsefor 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