Solaflex
Solaflex

Reputation: 1432

Make input box with predefined Value

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

Answers (1)

Musaab Al-Okaidi
Musaab Al-Okaidi

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

Related Questions