23
23
using System . Management . Automation ;
24
24
using System . Management . Automation . Host ;
25
25
using System . Reflection ;
26
+ using System . Linq ;
27
+ using System . Globalization ;
26
28
27
29
namespace Microsoft . Azure . Commands . ResourceManager . Common
28
30
{
@@ -140,9 +142,10 @@ protected override void PromptForDataCollectionProfileIfNotExists()
140
142
141
143
protected override void InitializeQosEvent ( )
142
144
{
145
+ var commandAlias = this . GetType ( ) . GetTypeInfo ( ) . GetCustomAttribute < CliCommandAliasAttribute > ( ) ;
143
146
QosEvent = new AzurePSQoSEvent ( )
144
147
{
145
- CommandName = this . MyInvocation ? . MyCommand ? . Name ,
148
+ CommandName = commandAlias != null ? "az " + commandAlias . CommandName : this . MyInvocation ? . MyCommand ? . Name ,
146
149
ModuleName = this . GetType ( ) . GetTypeInfo ( ) . Assembly . GetName ( ) . Name ,
147
150
ModuleVersion = this . GetType ( ) . GetTypeInfo ( ) . Assembly . GetName ( ) . Version . ToString ( ) ,
148
151
ClientRequestId = this . _clientRequestId ,
@@ -151,7 +154,9 @@ protected override void InitializeQosEvent()
151
154
152
155
if ( this . MyInvocation != null && this . MyInvocation . BoundParameters != null )
153
156
{
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 ( ) ) ) ) ;
155
160
}
156
161
157
162
if ( this . DefaultProfile ? . Context ? . Account ? . Id != null )
0 commit comments