powershell - 使用预定义值制作输入框

标签 powershell

有没有办法创建一个在文本字段中已有预定义值的输入框?

首选方式是Read-Host

最佳答案

我认为不能使用 Read-Host 来完成此操作,但您仍然可以通过使用底层 .NET 类从 Powershell 中完成此操作,如下所示:

[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
$Value = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Value", "Test", "Default Value")

关于powershell - 使用预定义值制作输入框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16208013/

相关文章:

powershell - 将输入变量从批处理文件发送到 powershell 脚本

PowerShell 包来源确认

powershell - 获取对给定 PowerShell 模块的所有引用

amazon-web-services - 使用 PowerShell Core 上传到 Amazon S3 存储桶

azure - 循环访问 Azure 管道中的变量

powershell - 如何为具有许多路径参数的EXE创建PS别名?

powershell - 用于在Active Directory中提取各种数据字段的Powershell脚本

c# - PowerShell - X509Certificates.X509Store 获取所有证书?

powershell - 从列表中删除 ContentType Office 365

powershell - Chocolatey 在安装 openvpn 时返回错误