Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit ff9909f

Browse files
committed
handle case for CI where windowwidth is 0
1 parent 706f32a commit ff9909f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Microsoft.PowerShell.TextUtility.format.ps1xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575

7676
$consoleWidth = 120
7777
try {
78-
$consoleWidth = [Console]::WindowWidth
78+
if ([Console]::WindowWidth -ne 0) {
79+
$consoleWidth = [Console]::WindowWidth
80+
}
7981
}
8082
catch {
8183
# just use default if this fails because there isn't a real console

test/CompareText.tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ example text. used!
4848

4949
It 'Compare with sideybyside works' {
5050
$out = Compare-Text $leftText $rightText -View SideBySide | Out-String
51-
write-verbose -verbose "Width: $([Console]::WindowWidth)"
5251
$out | Should -BeExactly $expectedSideBySide
5352
}
5453
}

0 commit comments

Comments
 (0)