title: How can you set focus to an inputbox with PowerShell?
body: <p>I'm using the following PowerShell 2.0 code to grab input from a vb inputbox:</p>
  
  <pre><code>[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
  $name = [Microsoft.VisualBasic.Interaction]::InputBox("What is your name?", "Name", "bob")
  </code></pre>
  
  <p>Sometimes when I run it the input box appears behind the active window. Is there a way to make the input box top most? Or an easy way to get its handle and just use setforegroundwindow?</p>
  
  <p>Thanks!!</p>