简体   繁体   English

Windows PowerShell ISE不支持输入

[英]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: 使用经典cmdConsole2我输入:

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.

相关问题 WriteConsole 不适用于 PowerShell ISE? - WriteConsole doesn't work with PowerShell ISE? ExtractAssociatedIcon - 在 PowerShell ISE 中工作正常,但在控制台中不起作用 - ExtractAssociatedIcon - In PowerShell ISE Work's fine, But in Console Doesn't Work Powershell的Start-Process命令不会在Powershell ise之外启动exe - Powershell's Start-Process command doesn't start exe anywere outside Powershell ise Windows高对比度主题中的Powershell ISE编辑器 - Powershell ISE Editor in Windows High Contrast Theme Powershell 将 export-csv 与 Windows Powershell ISE 中显示的格式匹配 - Powershell match export-csv with format shown in Windows Powershell ISE Powershell:Windows Server 2008文件夹浏览器对话框为空白,但不在ISE中 - Powershell: Windows Server 2008 folder browser dialog blank, but not in ISE Windows 10 Powershell ise压缩存档文件位于root .in .zip中 - Windows 10 powershell ise compress-archive files at root .in .zip Get-VICommand在PowerCLI中工作,但在Windows PowerShell ISE中无法识别 - Get-VICommand works in PowerCLI, but not recognized in Windows PowerShell ISE Firefox 自动化使用 Selenium Powershell ISE, ZAEA23489CE3AA9B6406EBB28E0CDA403 - Firefox automation using Selenium Powershell ISE, Windows 10 为什么“设置项”在Windows 7 PowerShell上不起作用? - Why doesn't “Set-Item” work on Windows 7 PowerShell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM