Prerequisites
Steps to reproduce
Write-Host renders an instance of Dictionary inconsistently depending on how the value is passed in: Write-Host $d vs. $d | Write-Host.
$d = [System.Collections.Generic.Dictionary[string,string]]::new()
$d.Add('abc', 'def')
$d.Add('hhh', 'nnn')
Write-Host $d
> [abc, def] [hhh, nnn]
$d | Write-Host
> System.Collections.Generic.Dictionary`2[System.String,System.String]
Expected behavior
The rendering result should be consistent.
Actual behavior
## Not consistent.
Write-Host $d
> [abc, def] [hhh, nnn]
$d | Write-Host
> System.Collections.Generic.Dictionary`2[System.String,System.String]
Error details
Environment data
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
Write-Hostrenders an instance ofDictionaryinconsistently depending on how the value is passed in:Write-Host $dvs.$d | Write-Host.Expected behavior
The rendering result should be consistent.Actual behavior
Error details
N/AEnvironment data
Visuals
No response