Skip to content

Set-OktaConfiguration doesnt set values if the passed in parameter equates to $false #70

@TriggerAu

Description

@TriggerAu

portions of the codebase us statements like this to set values - I think its meant to be doing this based on if a parameter was passed

If ($MaxRetries) {
$Script:Configuration['MaxRetries'] = $MaxRetries
}

But the problem with this is that if the passed in value is 0 then the if is false and thus the values never set
eg this example shows the problem

$MaxRetries = 0
If ($MaxRetries) {
    $Script:Configuration['MaxRetries'] = $MaxRetries
} else {
    "No Value"
}

^ will output No-Value

The specific Set-OktaConfigurationMaxRetries works finem but these if statements in methods for checking parameters are problemmatic if the user is trying to set 0 or ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions