Hi,
I have created a form window using PowerShell to just install ADDS in a server. I click the start button it starts the function but then instead of installing the feature it gets stuck in 10 % and displays warning.
Warning message:
warning: the plug-in for “active directory domain services” is taking more time to load than expected.
Code:
Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing [System.Windows.Forms.Application]::EnableVisualStyles() [System.Windows.Forms.FormClosingEventHandler] $Form = New-Object system.Windows.Forms.Form $Form.ClientSize = '600,200' $Form.text = "DC Promotion " $Form.TopMost = $true $Button1 = New-Object system.Windows.Forms.Button $Button1.text = "Start" $Button1.width = 150 $Button1.height = 30 $Button1.DialogResult = [System.Windows.Forms.DialogResult]::OK $Button1.location = New-Object System.Drawing.Point(200, 140) $Button1.Font = 'Segoe UI,10' $Button1.Add_Click({Button1_Click;}) $Form.controls.AddRange(@( $Button1)) ######### code Starts ########### function Button1_Click() { Install-WindowsFeature –Name AD-Domain-Services -IncludeManagementTools } ####### end of code ###### [void]$Form.Add_Shown({ $Form.Activate() }) [void]$Form.ShowDialog()
Don’t understand running the code only from PowerShell does the job but using it form get it stuck.