You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
vexx32
changed the title
Fix PSSA rule PSAvoidDefaultValueSwitchParameter violation in New-CcmDeploymentStep
Fix PSSA rule violation in New-CcmDeploymentStep
Jun 30, 2022
What You Are Seeing?
This parameter declaration breaks the PSSA rule
PSAvoidDefaultValueSwitchParameter
because 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
-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
The text was updated successfully, but these errors were encountered: