Note: This is merely an inconsistency with other cmdlets that support calculated properties, such as Select-Object, where n / name and l / label can be used interchangeably to name a property.
ConvertTo-Html only supports l / label.
Steps to reproduce
'one' | Select-Object @{ n='Name'; e={ $_ } }
'one' | ConvertTo-Html -Property @{ n='Name'; e={ $_ } }
Expected behavior
Name
----
one
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML TABLE</title>
</head><body>
<table>
<colgroup><col/></colgroup>
<tr><th>Name</th></tr>
<tr><td>one</td></tr>
</table>
</body></html>
Actual behavior
Name
----
one
ConvertTo-Html : The n key is not valid.
Environment data
PowerShell Core v6.1.0-preview.2 on macOS 10.13.4
PowerShell Core v6.1.0-preview.2 on Ubuntu 16.04.4 LTS
PowerShell Core v6.1.0-preview.2 on Microsoft Windows 10 Pro (64-bit; Version 1709, OS Build: 16299.371)
Windows PowerShell v5.1.17134.48 on Microsoft Windows 10 Pro (64-bit; Version 1709, OS Build: 16299.371)
Note: This is merely an inconsistency with other cmdlets that support calculated properties, such as
Select-Object, wheren/nameandl/labelcan be used interchangeably to name a property.ConvertTo-Htmlonly supportsl/label.Steps to reproduce
Expected behavior
Actual behavior
Environment data