From 56e07a011858c6dd8c8d7373e2fb7d0aadd662e1 Mon Sep 17 00:00:00 2001 From: "Mathias R. Jessen" Date: Sun, 9 Dec 2018 22:21:01 +0100 Subject: [PATCH] Remove incorrect modification of `depth` parameter Decrementing `depth` makes no sense here and causes nested PSObject instances with more than one property to generate invalid xml --- .../commands/utility/CustomSerialization.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs index 798be2aa43dc..839bcce2540b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs @@ -731,8 +731,6 @@ private void WritePSObjectProperties(PSObject source, int depth) depth = GetDepthOfSerialization(source, depth); - //Depth available for each property is one less - --depth; Dbg.Assert(depth >= 0, "depth should be greater or equal to zero"); if (source.GetSerializationMethod(null) == SerializationMethod.SpecificProperties) {