Search code examples
formspowershellscriptingtextbox

PowerShell Form building


I have built a pretty basic form for running New-ADUser and Add-AdGroupMember.

Right now I have it saved as a Function in psm1.

You bring up PS type the function name and the form loads on top of the powershell window. So far so good. But the users I have using it are wanting me to make the cursor active in the Textbox1 field automagically.

Anyone with an idea on somewhere I can find that info?


Solution

  • Set the focus on the textbox object:

    $textbox.Focus()