Skip to content

Commit a1180bf

Browse files
committed
Merge remote-tracking branch 'upstream/clu' into clu
2 parents 00efff5 + e216de3 commit a1180bf

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/CLU/Commands.Common/CmdletInfoHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage reques
6464
}
6565
if (ClientRequestId != null)
6666
{
67+
if (request.Headers.Contains("x-ms-client-request-id"))
68+
{
69+
request.Headers.Remove("x-ms-client-request-id");
70+
}
6771
request.Headers.TryAddWithoutValidation("x-ms-client-request-id", ClientRequestId);
6872
}
6973
return base.SendAsync(request, cancellationToken);

src/CLU/Commands.ResourceManager.Common/AzureRmCmdlet.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
using System.Management.Automation;
2424
using System.Management.Automation.Host;
2525
using System.Reflection;
26+
using System.Linq;
27+
using System.Globalization;
2628

2729
namespace Microsoft.Azure.Commands.ResourceManager.Common
2830
{
@@ -140,9 +142,10 @@ protected override void PromptForDataCollectionProfileIfNotExists()
140142

141143
protected override void InitializeQosEvent()
142144
{
145+
var commandAlias = this.GetType().GetTypeInfo().GetCustomAttribute<CliCommandAliasAttribute>();
143146
QosEvent = new AzurePSQoSEvent()
144147
{
145-
CommandName = this.MyInvocation?.MyCommand?.Name,
148+
CommandName = commandAlias != null ? "az " + commandAlias.CommandName : this.MyInvocation?.MyCommand?.Name,
146149
ModuleName = this.GetType().GetTypeInfo().Assembly.GetName().Name,
147150
ModuleVersion = this.GetType().GetTypeInfo().Assembly.GetName().Version.ToString(),
148151
ClientRequestId = this._clientRequestId,
@@ -151,7 +154,9 @@ protected override void InitializeQosEvent()
151154

152155
if (this.MyInvocation != null && this.MyInvocation.BoundParameters != null)
153156
{
154-
QosEvent.Parameters = string.Join(",", this.MyInvocation.BoundParameters.Keys);
157+
QosEvent.Parameters = string.Join(" ",
158+
this.MyInvocation.BoundParameters.Keys.Select(
159+
s => string.Format(CultureInfo.InvariantCulture, "--{0} xxx", s.ToLowerInvariant())));
155160
}
156161

157162
if (this.DefaultProfile?.Context?.Account?.Id != null)

src/CLU/Microsoft.CLU.Run/ConsoleInputOutput.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ public void WriteDebugLine(string message)
296296
/// <param name="message">The message to write</param>
297297
public void WriteErrorLine(string message)
298298
{
299-
CLUEnvironment.Console.WriteLine(message);
300299
WriteLine(ConsoleColor.Red, GetConsoleBgColor(), string.Format(Strings.ErrorLineFormat, message));
301300
}
302301

0 commit comments

Comments
 (0)