简体   繁体   中英

Carriage return doesn't work as expected in PowerShell ISE

I have this command:

Write-Host "123`r456" 

Output in stand-alone PowerShell:

456 

Output in PowerShell ISE:

123456 

Thanks.

The ISE doesn't behave like a normal console in many ways. 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.

This is one of the undocumented differences of ISE from the normal console. Documented ones are here: http://blogs.msdn.com/b/powershell/archive/2009/04/17/differences-between-the-ise-and-powershell-console.aspx

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