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

Fix PSSA rule violation in New-CcmDeploymentStep #64

Open
vexx32 opened this issue Jun 30, 2022 · 0 comments
Open

Fix PSSA rule violation in New-CcmDeploymentStep #64

vexx32 opened this issue Jun 30, 2022 · 0 comments
Labels
0 - Backlog Bug Something isn't working Up For Grabs Extra attention is needed
Milestone

Comments

@vexx32
Copy link
Member

vexx32 commented Jun 30, 2022

What You Are Seeing?

This parameter declaration breaks the PSSA rule PSAvoidDefaultValueSwitchParameter because the switch defaults to $true:

[parameter()]
[switch]
$FailOnError = $true,

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

@vexx32 vexx32 added Bug Something isn't working Up For Grabs Extra attention is needed 0 - _Triaging labels Jun 30, 2022
@vexx32 vexx32 changed the title Fix PSSA rule PSAvoidDefaultValueSwitchParameter violation in New-CcmDeploymentStep Fix PSSA rule violation in New-CcmDeploymentStep Jun 30, 2022
@vexx32 vexx32 added this to the 0.10.0 milestone Aug 31, 2022
@vexx32 vexx32 modified the milestones: 0.10.0, 0.2.1 Sep 3, 2022
@gep13 gep13 modified the milestones: 0.2.1, 0.10.0 Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog Bug Something isn't working Up For Grabs Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants