Fix Count errors in preview/zone helpers
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user