简体   繁体   中英

Windows PowerShell ISE doesn't promt for input

I am using console as my tool for managing mercurial repositories. Wtih classic cmd or Console2 I type:

hg in

And console prompts something like:

D:\workspace\someproject>hg in
http authorization required
realm: Bitbucket.org HTTP
user: xorty
password:

And obviously, I type password.

But when I type "hg in" in powershell console, it doesn't prompt anything. It just keeps saying this: Running script / selection. Press Ctrl + Break to stop Running script / selection. Press Ctrl + Break to stop

Can I make PowerShell ISE behave like classic console, or this isn't the way PowerShell is meant to work?

The PowerShell ISE indeed does not support console applications that require interactive input . The linked blog entry details options how to deal with that.

Since the PowerShell ISE is not a console, normal console applications cannot do everything they're used to, while of course PowerShell cmdlets can work just fine, since several things are dependent on the PowerShell host application (you get a graphical prompt with Read-Host, for example).

Console2 emulates a normal console by keeping the actual console around in a hidden window and polling it repeatedly for changes and, correspondingly, sending input to that window.

Powershell ISE ( integrated scripting environment ) is not the standard Powershell console. The ISE, like the name suggests, is a pretty basic GUI based script writing tool and doesn't support interactive console applications ( try just cmd on the ISE console and see the error message)

Open powershell.exe, and run the command that you want. It will behave pretty much like cmd. Or alternatively, press CTRL + SHIFT + P in the ISE and run the command there.

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