Reputation: 1432
Is there a way to create an input box which already has a predefined value in the textfield ?
Preferred way whould be Read-Host
Upvotes: 2
Views: 3908
Reputation: 3784
I don't think it can be done with Read-Host
, but you could still do it from Powershell by using the underlying .NET classes as follows:
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
$Value = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Value", "Test", "Default Value")
Upvotes: 5