Extracted from Search-UnifiedAuditLogCustom so the flattening logic is
reusable and unit-testable on its own.
Recursively expands nested objects,
dictionaries and lists into prefixed keys, and special-cases the audit
Parameters array (ParameterString / Param_* / FullCommand).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.