[英]Windows PowerShell ISE doesn't promt for input
I am using console as my tool for managing mercurial repositories. 我使用控制台作为管理mercurial存储库的工具。 Wtih classic cmd or Console2 I type: 使用经典cmd或Console2我输入:
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. 但是当我在powershell控制台中键入“hg in”时,它不会提示任何内容。 It just keeps saying this: Running script / selection. Press Ctrl + Break to stop
它只是一直这样说: 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? 我可以使PowerShell ISE像经典控制台一样运行,或者这不是PowerShell的工作方式吗?
The PowerShell ISE indeed does not support console applications that require interactive input . PowerShell ISE确实不支持需要交互式输入的控制台应用程序 。 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). 由于PowerShell ISE不是控制台,普通的控制台应用程序无法完成他们习惯的所有操作,当然PowerShell cmdlet可以正常工作,因为有些东西依赖于PowerShell主机应用程序(您可以获得带有Read-的图形提示主持人,例如)。
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. Console2通过将实际控制台保持在隐藏窗口中并反复轮询它以进行更改并相应地将输入发送到该窗口来模拟普通控制台。
Powershell ISE ( integrated scripting environment ) is not the standard Powershell console. Powershell ISE(集成脚本环境)不是标准的Powershell控制台。 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) ISE,顾名思义,是一个非常基本的基于GUI的脚本编写工具,不支持交互式控制台应用程序(在ISE控制台上尝试cmd
并查看错误消息)
Open powershell.exe, and run the command that you want. 打开powershell.exe,然后运行所需的命令。 It will behave pretty much like cmd. 它的行为非常像cmd。 Or alternatively, press CTRL + SHIFT + P in the ISE and run the command there. 或者,在ISE中按CTRL + SHIFT + P并在那里运行命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.