简体   繁体   English

回车无法在PowerShell ISE中按预期方式工作

[英]Carriage return doesn't work as expected in PowerShell ISE

I have this command: 我有以下命令:

Write-Host "123`r456" 

Output in stand-alone PowerShell: 在独立PowerShell中的输出:

456 

Output in PowerShell ISE: 在PowerShell ISE中输出:

123456 

Thanks. 谢谢。

The ISE doesn't behave like a normal console in many ways. ISE在许多方面都不像普通控制台那样运行。 While you would expect the carriage return to reset the position to the first character of a line, and hence give the outout 456 , the ISE does not work that way, so do not depend on that behaviour. 尽管您期望回车将位置重置为行的第一个字符,从而输出456 ,但ISE不能那样工作,因此不必依赖于该行为。

This is one of the undocumented differences of ISE from the normal console. 这是ISE与普通控制台的未记录差异之一。 Documented ones are here: http://blogs.msdn.com/b/powershell/archive/2009/04/17/differences-between-the-ise-and-powershell-console.aspx 记录在这里: http : //blogs.msdn.com/b/powershell/archive/2009/04/17/differences-between-the-ise-and-powershell-console.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM