Prerequisites
Steps to reproduce
Write-Error foo 2>$null
$e = $Error[0]
$e | Get-Member -View Extended | Out-Host
'---'
# !! The unexpected decoration happens here.
# !! Ditto with Export-CliXml
$null = $e | ConvertTo-CliXml
$e | Get-Member -View Extended | Out-Host
Expected behavior
Both Get-Member calls should yield the same output.
Actual behavior
The second Get-Member call reveals many additional NoteProperty members, such as ErrorCategory_Activity.
These members are properties created for serializing ErrorRecord instances, but attaching them to the input objects is inappropriate.
Error details
Environment data
PowerShell 7.6.0-preview.4 (goes back to WinPS)
Visuals
No response
Prerequisites
Steps to reproduce
Expected behavior
Both
Get-Membercalls should yield the same output.Actual behavior
The second
Get-Membercall reveals many additionalNotePropertymembers, such asErrorCategory_Activity.These members are properties created for serializing
ErrorRecordinstances, but attaching them to the input objects is inappropriate.Error details
Environment data
Visuals
No response