Powershell script output line wrap

This is a minor annoyance, but I notice that output from my PreDeploy.ps1 or Deploy.ps1 is being wrapped at 80 characters, whereas other logging lines are left alone.

I suspect the problem is that powershell is deciding (because it’s smarter than you) that you want word wrapping, maybe because the default console-host attached to the shell has 80 columns.

Just a quick follow up: Write-Host seems to prevent unwanted line wrapping in powershell, where as Write-Output seems to be responsible for this stupid unwanted line wrapping behavior.

And one more follow up: it seems the word wrapping is influenced by $host.UI.RawUI.BufferSize which can be overridden by the script.

One work-around could be to put something in the profile script to make sure it gets set during each powershell invocation.

See also: http://weblogs.asp.net/soever/archive/2008/12/09/powershell-output-capturing-and-text-wrapping-strange-quirks-solved.aspx

Thanks Chris, the buffer size will be set to 500 in the next release!

Paul

has this change been deployed yet? in what version? if not, what version can we expect it?

thanks.

Hi Mike,

This change has been implemented quite a while ago :slight_smile:

Thanks

Dalmiro