# Edit This item to change the DropDown Values $DropDownArray = @( "Crofton", "Washington", "Fairfax", "Baltimore") # This Function Returns the Selected Value and Closes the Form function Return-DropDown { $Choice = $DropDown.SelectedItem.ToString() $Form.Close() Write-Host $Choice } [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") > NULL [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") > NULL $Form = New-Object System.Windows.Forms.Form $Form.width = 300 $Form.height = 150 $Form.Text = ”DropDown” $DropDown = new-object System.Windows.Forms.ComboBox $DropDown.Location = new-object System.Drawing.Size(100,10) $DropDown.Size = new-object System.Drawing.Size(130,30) ForEach ($Item in $DropDownArray) { $rc = $DropDown.Items.Add($Item) } $Form.Controls.Add($DropDown) $DropDownLabel = new-object System.Windows.Forms.Label $DropDownLabel.Location = new-object System.Drawing.Size(10,10) $DropDownLabel.size = new-object System.Drawing.Size(100,20) $DropDownLabel.Text = "Items" $Form.Controls.Add($DropDownLabel) $Button = new-object System.Windows.Forms.Button $Button.Location = new-object System.Drawing.Size(100,50) $Button.Size = new-object System.Drawing.Size(100,20) $Button.Text = "Select an Item" $Button.Add_Click({Return-DropDown}) $form.Controls.Add($Button) $Form.Add_Shown({$Form.Activate()}) $rc = $Form.ShowDialog()