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

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

Open
TriggerAu opened this issue Dec 19, 2024 · 1 comment · May be fixed by #73
Open

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

TriggerAu opened this issue Dec 19, 2024 · 1 comment · May be fixed by #73

Comments

@TriggerAu
Copy link
Contributor

TriggerAu commented Dec 19, 2024

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 ""

TriggerAu added a commit to TriggerAu/okta-powershell-cli that referenced this issue Dec 19, 2024
…ta#70)

Uses PSBoundParameter.ContainsKey rather than the if of the variable as
if the passed in value is 0 or $false the set is not done

same issue as okta#56, but in a different template
@laura-rodriguez
Copy link
Collaborator

Thanks for reporting this issue, @TriggerAu. We still have your Okta Retry PR pending review, so we'll include this issue when reviewing that one as they're both related. Thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants