PowerShell读取主机

PowerShell读取主机,powershell,user-interface,Powershell,User Interface,因此,在我的PS脚本中,我向用户询问了多个问题 例如: $username = Read-Host("What is your username?") $password = Read-Host("What is your password?") $monthName = Read-Host("Which month are you running this report for?") $data = Read-Host("Enter the full path to the data file

因此,在我的PS脚本中,我向用户询问了多个问题

例如:

$username = Read-Host("What is your username?")
$password = Read-Host("What is your password?")
$monthName = Read-Host("Which month are you running this report for?")
$data = Read-Host("Enter the full path to the data file you would like to report?")
我知道如果我做了一个GUI,我可以一次问所有这些问题,但是我以前没有用PS做过GUI(尽管我正在尝试)

有没有其他方法可以在不构建GUI的情况下一次问所有这些问题


谢谢

我建议只使用原始表单来创建gui。它就像拖放窗口、文本框、按钮等一样简单。它根据您的设计生成适当的脚本,您只需将代码复制到PowerShell中

。。而且是免费的!(社区版,超出您的需要)。。只需创建一个帐户

嗯,很有趣。如果它有点像VisualStudio,它肯定会帮助我。我正在下载,谢谢@大兔子是的,就像that@BigRabbit请看这里:。。。你很想看到这样的评论:
#TODO:在这里放置自定义脚本
,但是你可以创建函数并从事件中调用它们,以保持代码整洁是的,我想我明白了,我看了几个例子。谢谢你的帮助,非常感谢!