PowerShell读取主机

时间:2014-03-14 17:00:12

标签: 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 you would like to report?")

我知道如果我制作一个GUI,我可以立即提出所有这些问题,但是我之前没有在PS中制作过GUI(虽然我正在尝试)。

有没有其他方法可以一次性提出所有这些问题,而无需构建GUI?

感谢。

1 个答案:

答案 0 :(得分:2)

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

..而且它是免费的! (社区版,这不仅仅是你需要的)..只需创建一个帐户
http://www.sapien.com/software/communitytools#PrimalFormsCE