Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法创建一个在文本字段中已经有预定义值的输入框?
首选方式应该是Read-Host
Read-Host
我不认为它可以用 .NET 来完成Read-Host,但你仍然可以通过使用下面的 .NET 类从 Powershell 来完成,如下所示:
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') $Value = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Value", "Test", "Default Value")