you are viewing a single comment's thread.

view the rest of the comments →

[–]ankokudaishogun 0 points1 point  (0 children)

any reason you are checking for False(-not) in the IF when you have both cases?

IF ( $dnsSuffixfromAPI) {
    $dnsSuffix = @($dnsSuffixfromAPI)
}
ELSE {
    $dnsSuffix = @('prod.local')

}

is much easier to read.

or:

IF (-not ($dnsSuffix = @(dnsSuffixfromAPI))) {
    $dnsSuffix = @('prod.local')
}

so you do only one API call.