From a6479f818191f901bab6ff2339cabe0334107202 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Wed, 28 Mar 2018 13:34:29 -0700 Subject: [PATCH] Make sure that the width of the header is at least the size of the label (or propertyname) (#6487) --- .../DefaultFormatters/DotNetTypes_format_ps1xml.cs | 2 +- test/powershell/engine/Basic/SemanticVersion.Tests.ps1 | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs index 7e083ef66d..b5deb6b489 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs @@ -512,7 +512,7 @@ namespace System.Management.Automation.Runspaces .AddHeader(width: 6) .AddHeader(width: 6) .AddHeader(width: 6) - .AddHeader(width: 9) + .AddHeader(width: 15) .AddHeader(width: 11) .StartRowDefinition() .AddPropertyColumn("Major") diff --git a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 index 0d5f3d3fbd..55a2d2ab6e 100644 --- a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 +++ b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 @@ -245,4 +245,10 @@ Describe "SemanticVersion api tests" -Tags 'CI' { $des.ToString() | Should -Be $expectedResult } } + + Context "Formatting" { + It "Should not throw when default format-table is used" { + { $PSVersionTable.PSVersion | Format-Table | Out-String } | Should -Not -Throw + } + } }