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
I am attempting to add a NoteProperty to a reference type property of an object, then convert that entire object to JSON using the ConvertTo-Json cmdlet. While this works fine when adding a NoteProperty to a top level object, if you do this to an object that's a property of the top-level object, the NoteProperty is not handled by the cmdlet:
Output does not include additional property:{ ... "SID": { "BinaryLength": 28, "AccountDomainSid": { "BinaryLength": 24, "AccountDomainSid": [redacted], "Value": [redacted] }, "Value": [redacted] }, ...}
Error details
No response
Environment data
Name Value
---------
PSVersion 7.3.2
PSEdition Core
GitCommitId 7.3.2
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Prerequisites
Steps to reproduce
I am attempting to add a NoteProperty to a reference type property of an object, then convert that entire object to JSON using the ConvertTo-Json cmdlet. While this works fine when adding a NoteProperty to a top level object, if you do this to an object that's a property of the top-level object, the NoteProperty is not handled by the cmdlet:
`$foo = Get-ADUser "someUser"
$foo.SID | Add-Member -MemberType NoteProperty -Name "bar" -Value "barValue" -Force
$foo | ConvertTo-Json`
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response