-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
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
N/AEnvironment 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.0Visuals
No response
mklement0 and alx9r
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group