简体   繁体   中英

PowerShell Read-Host

SO, in my PS script I am asking the user multiple questions.

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).

Is there any other way I can ask all of these questions at once, without building a GUI?

Thanks.

I suggest just using Primal Forms to create a 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.

.. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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