Please note the output of the following block of code on PowerShell -
$Attendees = @( @{ "EmailAddress" = [pscustomobject]@{ "Address" = "[email protected]"; "Name" = "test1"; }; "Type" = "Required"; }; ); ConvertTo-Json $Attendees; $PSObject = @{ "Attendees" = $Attendees; }; ConvertTo-Json $PSObject;
Output -
Note how "EmailAddress" changes from object to a string. How can I prevent this from happening?
2.1m questions
2.1m answers
60 comments
57.0k users