Skip to content

Titles misalignment #6767

@NJ-Dude

Description

@NJ-Dude

Steps to reproduce

It seems there's a problem with Add-Member/Write-Output and displaying titles.

Input:

$Values = @{"DEVELOPMENT-PC", "Windows 10 Pro - Development", "", "Online"}

Code:

$OutputObj = New-Object -TypeName PSObject
$OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Values[0]
$OutputObj | Add-Member -MemberType NoteProperty -Name Description -Value "$($Values[1])"
$OutputObj | Add-Member -MemberType NoteProperty -Name ADDescription -Value "$($Values[2])"
$OutputObj | Add-Member -MemberType NoteProperty -Name Status -Value $Values[3]
                 
Write-Output $OutputObj

Expected behavior

ComputerName   Description                  ADDescription Status
------------   -----------                  ------------- ------
DEVELOPMENT-PC Windows 10 Pro - Development               Online

Actual behavior

ComputerName   Description ADDescription Status
------------   -----------                  ------------- ------
DEVELOPMENT-PC Windows 10 Pro - Development               Online

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.2
PSEdition                      Core
GitCommitId                    v6.1.0-preview.2
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions