Skip to content

Commit 9f19993

Browse files
committed
Updating command alias attributes to use spaces for resource manager
2 parents 5dbe92a + 41dd4e7 commit 9f19993

File tree

596 files changed

+8734
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+8734
-504
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.Common/MetricHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static void LogUsageEvent(AzurePSQoSEvent qos)
111111
{
112112
var pageViewTelemetry = new PageViewTelemetry
113113
{
114-
Name = qos.CommandName,
114+
Name = qos.CommandName ?? "empty",
115115
Duration = qos.Duration,
116116
Timestamp = qos.StartTime
117117
};

src/CLU/Commands.ResourceManager.Cmdlets/Extensions/ResourceExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ internal static PSResourceObject ToPSResourceObject(this Resource<JToken> resour
6262
psObject.SubscriptionId = string.IsNullOrEmpty(resource.Id) ? null : ResourceIdUtility.GetSubscriptionId(resource.Id);
6363
psObject.Tags = TagsHelper.GetTagsHashtables(resource.Tags);
6464

65-
6665
var objectProperties = objectDefinition.Where(kvp => kvp.Value != null).SelectManyArray(kvp => new[] { kvp.Key, kvp.Value });
6766

6867
for(int i=0; i< objectProperties.Length; i+=2)

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.Azure.Commands.Compute/AvailabilitySets/GetAzureAvailabilitySetCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Compute
2323
{
2424
[Cmdlet(VerbsCommon.Get, ProfileNouns.AvailabilitySet)]
2525
[OutputType(typeof(PSAvailabilitySet))]
26-
[CliCommandAlias("vm;availabilityset;ls")]
26+
[CliCommandAlias("vm availabilityset ls")]
2727
public class GetAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2828
{
2929
[Parameter(

src/CLU/Microsoft.Azure.Commands.Compute/AvailabilitySets/NewAzureAvailabilitySetCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Compute
2323
{
2424
[Cmdlet(VerbsCommon.New, ProfileNouns.AvailabilitySet)]
2525
[OutputType(typeof(PSAvailabilitySet))]
26-
[CliCommandAlias("vm;availabilityset;new")]
26+
[CliCommandAlias("vm availabilityset new")]
2727
public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2828
{
2929
[Parameter(

src/CLU/Microsoft.Azure.Commands.Compute/AvailabilitySets/RemoveAzureAvailabilitySetCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
namespace Microsoft.Azure.Commands.Compute
2121
{
2222
[Cmdlet(VerbsCommon.Remove, ProfileNouns.AvailabilitySet)]
23-
[OutputType(typeof(PSOperation))]
24-
[CliCommandAlias("vm;availabilityset;rm")]
23+
[OutputType(typeof(void))]
24+
[CliCommandAlias("vm availabilityset rm")]
2525
public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2626
{
2727
[Parameter(
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Add-AzureRmVhd
3+
4+
5+
6+
7+
8+
Command syntax
9+
10+
az vhd add [[--resourcegroupname] <string>] [--destination] <Uri> [--localfilepath] <FileInfo> [[--numberofuploaderthreads] <Nullable`1[Int32]>] [[--baseimageuritopatch] <Uri>] [[--overwrite]] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
17+
18+
--destination
19+
20+
21+
--localfilepath
22+
23+
24+
--numberofuploaderthreads
25+
26+
27+
--baseimageuritopatch
28+
29+
30+
--overwrite
31+
32+
33+
--informationaction
34+
35+
36+
--informationvariable
37+
38+
39+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
Save-AzureRmVhd
3+
4+
5+
6+
7+
8+
Command syntax
9+
10+
az vhd save [--resourcegroupname] <string> [--sourceuri] <Uri> [--localfilepath] <FileInfo> [[--numberofthreads] <int>] [[--overwrite]] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
az vhd save [--storagekey] <string> [--sourceuri] <Uri> [--localfilepath] <FileInfo> [[--numberofthreads] <int>] [[--overwrite]] [--informationaction <ActionPreference>] [--informationvariable <string>]
13+
14+
15+
Parameters
16+
17+
--resourcegroupname
18+
19+
20+
--sourceuri
21+
22+
23+
--localfilepath
24+
25+
26+
--numberofthreads
27+
28+
29+
--overwrite
30+
31+
32+
--informationaction
33+
34+
35+
--informationvariable
36+
37+
38+
--storagekey
39+
40+
41+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
Get-AzureRmVMAccessExtension: Gets information about the VMAccess extension.
3+
4+
5+
The Get-AzureRmVMAccessExtension cmdlet gets information about the Virtual Machine Access (VMAccess) Virtual Machine Extension.
6+
7+
8+
Command syntax
9+
10+
az vm accessextension ls [--resourcegroupname] <string> [--vmname] <string> [--name] <string> [[--status]] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
Specifies the name of the resource group of the virtual machine.
17+
18+
--vmname
19+
Specifies the name of a virtual machine. This cmdlet gets information about VMAccess for the virtual machine that this parameter specifies.
20+
21+
--name
22+
Specifies the name of the extension that this cmdlet gets.
23+
24+
--status
25+
Indicates that this cmdlet gets only the instance view of the extension.
26+
27+
--informationaction
28+
29+
30+
--informationvariable
31+
32+
33+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
Remove-AzureRmVMAccessExtension: Removes the VMAccess extension from a virtual machine.
3+
4+
5+
The Remove-AzureRmVMAccessExtension cmdlet removes the Virtual Machine Access (VMAccess) Virtual Machine Extension from a virtual machine.
6+
7+
8+
Command syntax
9+
10+
az vm accessextension rm [--resourcegroupname] <string> [--vmname] <string> [--name] <string> [--force] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
Specifies the name of the resource group of the virtual machine.
17+
18+
--vmname
19+
Specifies the name of a virtual machine. This cmdlet removes VMAccess for the virtual machine that this parameter specifies.
20+
21+
--name
22+
Specifies the name of the extension that this cmdlet removes.
23+
24+
--force
25+
Forces the command to run without asking for user confirmation.
26+
27+
--informationaction
28+
29+
30+
--informationvariable
31+
32+
33+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
Set-AzureRmVMAccessExtension: Adds the VMAccess extension to a virtual machine.
3+
4+
5+
The Set-AzureRmVMAccessExtension cmdlet adds the Virtual Machine Access (VMAccess) Virtual Machine Extension to a virtual machine. VMAccess can reset the virtual machine user name and password.
6+
7+
8+
Command syntax
9+
10+
az vm accessextension set [--resourcegroupname] <string> [--vmname] <string> [--name] <string> [[--typehandlerversion] <string>] [[--username] <string>] [[--password] <string>] [[--location] <string>] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
Specifies the name of the resource group of the virtual machine.
17+
18+
--vmname
19+
Specifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies.
20+
21+
--name
22+
Specifies the name of the extension that this cmdlet adds.
23+
24+
--typehandlerversion
25+
Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.
26+
27+
--username
28+
Specifies the new user name for the virtual machine.
29+
30+
--password
31+
Specifies the new password of the virtual machine.
32+
33+
--location
34+
Specifies the location of the virtual machine.
35+
36+
--informationaction
37+
38+
39+
--informationvariable
40+
41+
42+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
Add-AzureRmVMAdditionalUnattendContent: Adds information to the unattended Windows Setup answer file.
3+
4+
5+
The Add-AzureRmVMAdditionalUnattendContent cmdlet adds information to the unattended Windows Setup answer file. Specify additional base 64 encoded XML formatted information that this cmdlet adds to the unattend.xml file.
6+
7+
8+
Command syntax
9+
10+
az vm additional unattend content add [--vm] <PSVirtualMachine> [[--content] <string>] [[--settingname] <string>] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--vm
16+
Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet.
17+
18+
--content
19+
Specifies base 64 encoded XML formatted content. This cmdlet adds the content to the unattend.xml file. The XML content must be less than 4 KB and must include the root element for the setting or feature that this cmdlet inserts.
20+
21+
--settingname
22+
Specifies the name of the setting to which the content applies. Valid values are:
23+
-- FirstLogonCommands
24+
-- AutoLogon
25+
26+
--informationaction
27+
28+
29+
--informationvariable
30+
31+
32+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Get-AzureRmAvailabilitySet: Gets Azure availability sets in a resource group.
3+
4+
5+
The Get-AzureRmAvailabilitySet cmdlet gets Azure availability sets in a resource group. Specify the name of a specific availability set to get.
6+
7+
8+
Command syntax
9+
10+
az vm availabilityset ls [--resourcegroupname] <string> [[--name] <string>] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
Specifies the name of a resource group.
17+
18+
--name
19+
Specifies the name of an availability set to get.
20+
21+
--informationaction
22+
23+
24+
--informationvariable
25+
26+
27+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
New-AzureRmAvailabilitySet: Creates an Azure availability set.
3+
4+
5+
The New-AzureRmAvailabilitySet cmdlet creates an Azure availability set.
6+
7+
8+
Command syntax
9+
10+
az vm availabilityset new [--resourcegroupname] <string> [--name] <string> [--location] <string> [[--platformupdatedomaincount] <Nullable`1[Int32]>] [[--platformfaultdomaincount] <Nullable`1[Int32]>] [--informationaction <ActionPreference>] [--informationvariable <string>]
11+
12+
13+
Parameters
14+
15+
--resourcegroupname
16+
Specifies the name of a resource group.
17+
18+
--name
19+
Specifies a name for the availability set.
20+
21+
--location
22+
Specifies the location for the availability set.
23+
24+
--platformupdatedomaincount
25+
Specifies the platform update domain count.
26+
27+
--platformfaultdomaincount
28+
Specifies the platform fault domain count.
29+
30+
--informationaction
31+
32+
33+
--informationvariable
34+
35+
36+

0 commit comments

Comments
 (0)