PowerShell JSON log contains truncated nested data
Documentation: Microsoft Learn
Work the problem
The nested value became text
Fictional case: A log parses as JSON, but a required nested object is represented as a type-name string. The serializer used its default depth.
Reasoning notebook
Record the evidence that supports your answer and the check you would run next. Your notes stay in this browser — nothing is uploaded.
Why it happens
ConvertTo-Json limits serialization depth. Nested objects beyond the selected depth are reduced instead of being fully represented.
Check this first
What to look for
The data shape must be included during serialization. Then parse it back and inspect the required nested value.
Working through it
- Compare the default serialization with a deliberately higher Depth value.
- Choose a depth that covers the schema you actually intend to log rather than using an extreme value blindly.
- Project large or sensitive nested objects to the fields the log needs before serialization.
- Parse one emitted line with ConvertFrom-Json and inspect the expected nested property.
Avoiding it next time
Verify the repair: Parse an emitted record and assert the nested property value and type expected by the consumer.
Primary documentation
Work through the incident
Check nested JSON output
A report serializes successfully but nested fields are missing.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.