You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConvertTo-Json neglects to serialize ETS properties when passed output from CDXML cmdlets (CIM instances) that isn't [psobject] wrapped by argument #24554
Note that the problem only arises for CDXML cmdlets that do not themselves wrap their output objects in [psobject], such as Get-PhysicalDisk, Get-VirtualDisk, and Get-Volume; others, such as Get-Disk, do perform this wrapping.
# Note: Since objects passing through the pipeline are automatically [psobject]-wrapped, the following# pipeline alternative works correctly: # Get-PhysicalDisk | ConvertTo-Json 3>$null | ConvertFrom-Json | Format-ListConvertTo-Json (Get-PhysicalDisk) 3>$null|ConvertFrom-Json|Format-List
Prerequisites
Steps to reproduce
Note:
This is yet another manifestation of Objects are situationally invisibly [psobject]-wrapped, sometimes causing unexpected behavior. #5579
Note that the problem only arises for CDXML cmdlets that do not themselves wrap their output objects in
[psobject], such asGet-PhysicalDisk,Get-VirtualDisk, andGet-Volume; others, such asGet-Disk, do perform this wrapping.Expected behavior
Actual behavior
That is, only the type-native properties were serialized, not also the ETS (adapted) ones.
Error details
No response
Environment data
Visuals
No response