简体   繁体   English

PowerShell读主机

[英]PowerShell Read-Host

SO, in my PS script I am asking the user multiple questions. 因此,在我的PS脚本中,我向用户询问了多个问题。

example: 例:

$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?")

I know if I make a GUI I can ask all of these questions at once, however I have not made a GUI in PS before(although I am trying). 我知道如果我制作了GUI,我可以一次询问所有这些问题,但是我以前没有在PS中制作过GUI(尽管我正在尝试)。

Is there any other way I can ask all of these questions at once, without building a GUI? 还有什么其他方法可以在不构建GUI的情况下立即询问所有这些问题?

Thanks. 谢谢。

I suggest just using Primal Forms to create a gui. 我建议仅使用原始表单来创建gui。 Its as easy as dragging and dropping windows, text boxes, buttons, ect. 就像拖放窗口,文本框,按钮等一样简单。 It generates the proper script based on what you designed and you just copy the code into PowerShell. 它会根据您的设计生成适当的脚本,您只需将代码复制到PowerShell中即可。

.. and it's FREE ! ..而且是免费的! (The community edition, which is more than you'll need) .. just create an account (社区版,这比您需要的更多)..只需创建一个帐户
http://www.sapien.com/software/communitytools#PrimalFormsCE http://www.sapien.com/software/communitytools#PrimalFormsCE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM