Get User Input From Command Line In Powershell !

preview_player
Показать описание

Use Read-Host to grab user input from the command line

SEE THE CODE:
Рекомендации по теме
Комментарии
Автор

If you want a pop up from within the console you'll have to code your own form, or adapt code from many examples on the internet for your purposes. One example is this technet article: .aspx at the end here - bypassing youtube link restriction) You'll notice it takes quite a bit of code to create the form, but it gives you ultimate control is displaying a visual interface for input or other actions. That's as official as I'm aware of at the moment

MrPowerScripts
Автор

Okay seriously - how the hell did you get that pop up window to show like that? I've done the technet walkthrough and seriously hate the UI. Literally been trying for hours to get my window to look like yours.

annix
Автор

I am trying to take user input remotely through a popup of yes/no button using invoke-command.. but i want to take input from user that is actually logged in to desktop not the one with which i am remotely running command.. is there a way??

kushagrajain
Автор

I just have a quick question. From the Powershell ISE, if I Read-Host I get a GUI popup for input, but if I call the script from a .bat via powershell -file myfile.ps1, the GUI popup doesn't come up and it just wants you to input to command prompt... is there a more official way to get that GUI to popup for input?

Thanks.

bfrdk