diff --git a/tools/Custom/HttpMessageLogFormatter.cs b/tools/Custom/HttpMessageLogFormatter.cs index 6c6cce78b48..797c5ab51f3 100644 --- a/tools/Custom/HttpMessageLogFormatter.cs +++ b/tools/Custom/HttpMessageLogFormatter.cs @@ -4,7 +4,6 @@ namespace Microsoft.Graph.PowerShell { - using Hyak.Common; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -92,11 +91,13 @@ private static string FormatString(string content) { try { - if (CloudException.IsJson(content)) + content = content.Trim(); + if ((content.StartsWith("{") && content.EndsWith("}")) || // object + (content.StartsWith("[") && content.EndsWith("]"))) // array { return JsonConvert.SerializeObject(JsonConvert.DeserializeObject(content), Formatting.Indented); } - if (CloudException.IsXml(content)) + if (content.StartsWith("<")) { return XDocument.Parse(content).ToString(); }