I found that documentation - which could works for me
I want to add something: i want to populate the list box with choices and depending of the choices made, i will run different commands
atl-dc-001 could be replaced by ping
atl-dc-002 could be replaced by tracert
If in the list box i select ping, when i press OK - i want an action to run and if i choose tracert i want a second action to run. I don’t find the right formula to make it works. Any idea?
Thanks
Ex:
[void] $listBox.Items.Add('atl-dc-001')[void] $listBox.Items.Add(‘atl-dc-002’)
[void] $listBox.Items.Add(‘atl-dc-003’)
$form.Controls.Add($listBox) $form.Topmost = $true $result = $form.ShowDialog()
if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
$x = $listBox.SelectedItem
$x
}