Fix Count errors in preview/zone helpers

This commit is contained in:
2026-01-29 11:32:17 +13:00
parent 06a1a6ada3
commit 6bbd32a75c

View File

@@ -72,7 +72,7 @@ function Get-FilePreview {
function Get-CommonZoneFromHosts { function Get-CommonZoneFromHosts {
param([string[]]$Hosts) param([string[]]$Hosts)
$fqdnHosts = $Hosts | Where-Object { $_ -and $_.Contains(".") } $fqdnHosts = @($Hosts | Where-Object { $_ -and $_.Contains(".") })
if (-not $fqdnHosts -or $fqdnHosts.Count -eq 0) { return "" } if (-not $fqdnHosts -or $fqdnHosts.Count -eq 0) { return "" }
$commonSuffix = $null $commonSuffix = $null
@@ -852,7 +852,7 @@ $replicationEnabledBox.Add_CheckedChanged({
$filePreviewBtn.Add_Click({ $filePreviewBtn.Add_Click({
$path = $fileBox.Text.Trim() $path = $fileBox.Text.Trim()
if ([string]::IsNullOrWhiteSpace($path)) { if ([string]::IsNullOrWhiteSpace($path)) {
$previewHosts = Split-List $hostsBox.Text $previewHosts = @(Split-List $hostsBox.Text)
if ($previewHosts.Count -gt 0) { if ($previewHosts.Count -gt 0) {
$filePreviewBox.Text = ($previewHosts | Select-Object -First 200) -join [Environment]::NewLine $filePreviewBox.Text = ($previewHosts | Select-Object -First 200) -join [Environment]::NewLine
return return