Skip to content

Fix PSSA rule violation in New-CcmDeploymentStep #64

@vexx32

Description

@vexx32

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - BacklogIssue 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.Up For GrabsIssues that are available by the community to work on.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions