Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ConvertTo-Html incorrectly labels default single column #2185

Copy link
Copy link
@TimCurwick

Description

@TimCurwick
Issue body actions

Previously documented on UserVoice https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11522970-convertto-html-incorrectly-labels-default-single-c

When the -Property parameter is not used (and it thereby defaults to match string '*') or when a match string is used with the -Property parameter, and the result is only a single property, ConvertTo-Html uses the match string as the column header instead of the property name.

Steps to reproduce

$X = [pscustomobject]@{ Name = 'Joe' } 
ConvertTo-Html -InputObject $X -Fragment
''
$X = [pscustomobject]@{ Name = 'Joe'; ID = 27 } 
ConvertTo-Html -InputObject $X -Property N* -Fragment

Expected behavior

Name
Joe
Name
Joe

Actual behavior

*
Joe
N*
Joe

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.9-248-g2b3f79345f83c42a1b45cfd860dc364d33300883
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

> $PSVersionTable
Name                           Value                                                                                                                                                                 
----                           -----                                                                                                                                                                 
PSVersion                      5.1.14393.103                                                                                                                                                         
PSEdition                      Desktop                                                                                                                                                               
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                               
BuildVersion                   10.0.14393.103                                                                                                                                                        
CLRVersion                     4.0.30319.42000                                                                                                                                                       
WSManStackVersion              3.0                                                                                                                                                                   
PSRemotingProtocolVersion      2.3                                                                                                                                                                   
SerializationVersion           1.1.0.1 
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.