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
Actual behavior
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
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
Expected behavior
Actual behavior
Environment data