@@ -172,8 +172,8 @@ function Import-DhcpScope {
172172
173173 if ($scopesToImport.Count -eq 0 ) {
174174 Write-Log " All scopes in $ImportFilePath already exist on $Server . No import performed." - Level " INFO"
175- [Windows.Forms.MessageBox ]::Show(" All scopes already exist on $Server .`n Nothing was imported." , " Info" , " OK" , " Information" )
176175 $ProgressBar.Value = 100
176+ $null = [Windows.Forms.MessageBox ]::Show(" All scopes already exist on $Server .`n Nothing was imported." , " Info" , " OK" , " Information" )
177177 return " Skipped"
178178 }
179179
@@ -284,15 +284,19 @@ function Show-GUI {
284284 }
285285
286286 $cmbDomain.Add_SelectedIndexChanged ({
287- $cmbScope.Items.Clear ()
288- $txtServer.Text = Get-DHCPServerFromDomain $cmbDomain.SelectedItem
289- if ($txtServer.Text ) {
290- Get-DhcpServerv4Scope - ComputerName $txtServer.Text | ForEach-Object {
291- $cmbScope.Items.Add ($_.ScopeId ) | Out-Null
292- }
287+ $cmbScope.Items.Clear ()
288+ $txtServer.Text = Get-DHCPServerFromDomain $cmbDomain.SelectedItem
289+ if ($txtServer.Text ) {
290+ Get-DhcpServerv4Scope - ComputerName $txtServer.Text | ForEach-Object {
291+ $cmbScope.Items.Add ($_.ScopeId ) | Out-Null
293292 }
294- $btnExport.Enabled = $txtServer.Text -and $cmbScope.Text
295- })
293+ }
294+ $btnExport.Enabled = $txtServer.Text -and $cmbScope.Text
295+ })
296+
297+ $cmbScope.Add_SelectedIndexChanged ({
298+ $btnExport.Enabled = $txtServer.Text -and $cmbScope.Text
299+ })
296300
297301 $cmbImpDomain.Add_SelectedIndexChanged ({
298302 $txtImpServer.Text = Get-DHCPServerFromDomain $cmbImpDomain.SelectedItem
0 commit comments