Skip to content

Commit

Permalink
Merge pull request #15 from jphayes/develop
Browse files Browse the repository at this point in the history
fix buffer size too large exception
  • Loading branch information
gep13 committed Dec 8, 2015
2 parents 2b30aef + da112b3 commit b25bc6d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions teamcity.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ if ($env:TEAMCITY_VERSION) {
# When PowerShell is started through TeamCity's Command Runner, the standard
# output will be wrapped at column 80 (a default). This has a negative impact
# on service messages, as TeamCity quite naturally fails parsing a wrapped
# message. The solution is to set a new, much wider output width. It will
# message. The solution is to set a new, wider output width. It will
# only be set if TEAMCITY_VERSION exists, i.e., if started by TeamCity.
$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(8192,50)
try {
$rawUI = (Get-Host).UI.RawUI
$m = $rawUI.MaxPhysicalWindowSize.Width
$rawUI.BufferSize = New-Object Management.Automation.Host.Size ([Math]::max($m, 500), $rawUI.BufferSize.Height)
$rawUI.WindowSize = New-Object Management.Automation.Host.Size ($m, $rawUI.WindowSize.Height)
} catch {
$ErrorMessage = $_.Exception.Message
Write-Host "WARNING: Failed setting buffer size - $ErrorMessage"
}
}

function TeamCity-TestSuiteStarted([string]$name) {
Expand Down

0 comments on commit b25bc6d

Please sign in to comment.