diff --git a/powershell/resources/runtime/csharp/pipeline/ISendAsync.cs b/powershell/resources/runtime/csharp/pipeline/ISendAsync.cs index 98696e712e..fb0cc28b94 100644 --- a/powershell/resources/runtime/csharp/pipeline/ISendAsync.cs +++ b/powershell/resources/runtime/csharp/pipeline/ISendAsync.cs @@ -252,12 +252,19 @@ internal static HttpRequestMessage Clone(this HttpRequestMessage original, Syste { clone.Properties.Add(prop); } - + foreach (KeyValuePair> header in original.Headers) - { + { + /* + **temporarily skip cloning telemetry related headers** clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } } - + return clone; } @@ -286,4 +293,4 @@ internal static async Task CloneWithContent(this HttpRequest return clone; } } -} \ No newline at end of file +}