Stabilize Count access in run flow
This commit is contained in:
10
certy.ps1
10
certy.ps1
@@ -892,7 +892,7 @@ $csrImportBtn.Add_Click({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$csrHosts = $csrFiles | ForEach-Object { $_.BaseName.Trim() } | Where-Object { $_ }
|
$csrHosts = @($csrFiles | ForEach-Object { $_.BaseName.Trim() } | Where-Object { $_ })
|
||||||
$currentHosts = Split-List $hostsBox.Text
|
$currentHosts = Split-List $hostsBox.Text
|
||||||
$merged = Merge-Hostnames -Existing $currentHosts -NewItems $csrHosts
|
$merged = Merge-Hostnames -Existing $currentHosts -NewItems $csrHosts
|
||||||
$hostsBox.Text = ($merged -join [Environment]::NewLine)
|
$hostsBox.Text = ($merged -join [Environment]::NewLine)
|
||||||
@@ -905,7 +905,7 @@ $csrImportBtn.Add_Click({
|
|||||||
$dnsScanBtn.Add_Click({
|
$dnsScanBtn.Add_Click({
|
||||||
try {
|
try {
|
||||||
$dnsListBox.Items.Clear()
|
$dnsListBox.Items.Clear()
|
||||||
$servers = Get-DnsServerCandidates
|
$servers = @(Get-DnsServerCandidates)
|
||||||
if (-not $servers -or $servers.Count -eq 0) {
|
if (-not $servers -or $servers.Count -eq 0) {
|
||||||
& $logAction "No DNS servers found. Enter servers manually."
|
& $logAction "No DNS servers found. Enter servers manually."
|
||||||
return
|
return
|
||||||
@@ -1025,7 +1025,7 @@ $runBtn.Add_Click({
|
|||||||
throw "PFX password is required."
|
throw "PFX password is required."
|
||||||
}
|
}
|
||||||
|
|
||||||
$hostEntries = $hosts | ForEach-Object { Resolve-HostEntry -Name $_ -Zone $zone -UseProvidedFqdn $useFqdnBox.Checked } | Where-Object { $_ }
|
$hostEntries = @($hosts | ForEach-Object { Resolve-HostEntry -Name $_ -Zone $zone -UseProvidedFqdn $useFqdnBox.Checked } | Where-Object { $_ })
|
||||||
|
|
||||||
& $logAction "Processing $($hostEntries.Count) hostname(s)."
|
& $logAction "Processing $($hostEntries.Count) hostname(s)."
|
||||||
|
|
||||||
@@ -1037,7 +1037,7 @@ $runBtn.Add_Click({
|
|||||||
if ($selectedReplicationTargets.Count -gt 0) {
|
if ($selectedReplicationTargets.Count -gt 0) {
|
||||||
$replicationTargets = $selectedReplicationTargets
|
$replicationTargets = $selectedReplicationTargets
|
||||||
} else {
|
} else {
|
||||||
$replicationTargets = Split-List $replicationTargetsBox.Text
|
$replicationTargets = @(Split-List $replicationTargetsBox.Text)
|
||||||
if ($replicationTargets.Count -eq 0 -and $dnsServer) {
|
if ($replicationTargets.Count -eq 0 -and $dnsServer) {
|
||||||
$replicationTargets = @($dnsServer)
|
$replicationTargets = @($dnsServer)
|
||||||
& $logAction "Replication targets empty; using primary DNS server $dnsServer."
|
& $logAction "Replication targets empty; using primary DNS server $dnsServer."
|
||||||
@@ -1071,7 +1071,7 @@ $runBtn.Add_Click({
|
|||||||
-Log $logAction
|
-Log $logAction
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$hostList = $hostEntries | ForEach-Object { $_.Fqdn }
|
$hostList = @($hostEntries | ForEach-Object { $_.Fqdn } | Where-Object { $_ })
|
||||||
& $logAction "Requesting one certificate with $($hostList.Count) hostname(s)."
|
& $logAction "Requesting one certificate with $($hostList.Count) hostname(s)."
|
||||||
Invoke-Wacs `
|
Invoke-Wacs `
|
||||||
-WacsPath $wacsPath `
|
-WacsPath $wacsPath `
|
||||||
|
|||||||
Reference in New Issue
Block a user