Beware Of Hidden Password Requests

by Mar 3, 2014

You can run PowerShell code in any host, and Windows ships with powershell.exe and powershell_ise.exe. Many prefer the graphical ISE editor over the simple PowerShell console.

Once you start using console applications, you must be aware that the ISE editor has no real console. Any time a console application wants to interact with you, this fails in the ISE editor.

So while choice.exe works just fine in the console, when you run the same command in the ISE editor, there is no way for choice.exe to receive your key press.

Sometime, this may even lead to unexpected results. When you run driverquery.exe with the parameter /S Servername to read drivers from a remote system, when run in the ISE editor, the editor may seem to be stuck.

When you run the same command in the console, you know why: driverquery.exe may display a prompt and ask for a password. Neither this prompt nor your input can be processed inside the ISE editor – since it has no console buffer.

So while it is perfectly OK to work in the ISE editor, when your scripts use console applications, you better run them in a classic PowerShell console.

Twitter This Tip! ReTweet this Tip!