Display InputBox for user input


posted by Tobias Weltner
11-26-2008

Downloads: 746
File size: 209 B
Views: 13,608

Embed
Display InputBox for user input
  1. [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic'
  2.  
  3. $name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "$env:username"
  4.  
  5. "Your name is $name" 
Filed under: , ,
illustrates how to use VisualBasic methods like InputBox to display a freetext dialog for users to enter text. It also demos how to have the dialog display a default text.
Copyright 2012 PowerShell.com. All rights reserved.