Skip to content

Commit 5a13577

Browse files
committed
update
1 parent b26eb7a commit 5a13577

29 files changed

+276
-97
lines changed
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ----------------------------------------------------------------------------------
1+
// ----------------------------------------------------------------------------------
22
//
33
// Copyright Microsoft Corporation
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.Compute;
16-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
17-
using System.Management.Automation;
1816

1917
namespace Microsoft.Azure.Commands.Compute
2018
{
@@ -27,22 +25,5 @@ public IAvailabilitySetOperations AvailabilitySetClient
2725
return ComputeClient.ComputeManagementClient.AvailabilitySets;
2826
}
2927
}
30-
31-
[Parameter(
32-
Mandatory = true,
33-
Position = 0,
34-
ValueFromPipelineByPropertyName = true,
35-
HelpMessage = "The resource group name.")]
36-
[ValidateNotNullOrEmpty]
37-
public virtual string ResourceGroupName { get; set; }
38-
39-
[Alias("ResourceName")]
40-
[Parameter(
41-
Mandatory = true,
42-
Position = 1,
43-
ValueFromPipelineByPropertyName = true,
44-
HelpMessage = "The resource name.")]
45-
[ValidateNotNullOrEmpty]
46-
public virtual string Name { get; set; }
4728
}
4829
}

src/ResourceManager/Compute/Commands.Compute/AvailabilitySets/GetAzureAvailabilitySetCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public class GetAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
3131
ValueFromPipelineByPropertyName = true,
3232
HelpMessage = "The resource group name.")]
3333
[ValidateNotNullOrEmpty]
34-
public override string ResourceGroupName { get; set; }
34+
public string ResourceGroupName { get; set; }
3535

3636
[Alias("ResourceName", "AvailabilitySetName")]
3737
[Parameter(
3838
Position = 1,
3939
ValueFromPipelineByPropertyName = true,
4040
HelpMessage = "The availability set name.")]
4141
[ValidateNotNullOrEmpty]
42-
public override string Name { get; set; }
42+
public string Name { get; set; }
4343

4444
public override void ExecuteCmdlet()
4545
{

src/ResourceManager/Compute/Commands.Compute/AvailabilitySets/NewAzureAvailabilitySetCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2828
ValueFromPipelineByPropertyName = true,
2929
HelpMessage = "The resource group name.")]
3030
[ValidateNotNullOrEmpty]
31-
public override string ResourceGroupName { get; set; }
31+
public string ResourceGroupName { get; set; }
3232

3333
[Alias("ResourceName", "AvailabilitySetName")]
3434
[Parameter(
@@ -37,7 +37,7 @@ public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
3737
ValueFromPipelineByPropertyName = true,
3838
HelpMessage = "The resource name.")]
3939
[ValidateNotNullOrEmpty]
40-
public override string Name { get; set; }
40+
public string Name { get; set; }
4141

4242
[Parameter(
4343
Mandatory = true,

src/ResourceManager/Compute/Commands.Compute/AvailabilitySets/RemoveAzureAvailabilitySetCommand.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ namespace Microsoft.Azure.Commands.Compute
2121
[Cmdlet(VerbsCommon.Remove, ProfileNouns.AvailabilitySet)]
2222
public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2323
{
24+
[Parameter(
25+
Mandatory = true,
26+
Position = 0,
27+
ValueFromPipelineByPropertyName = true,
28+
HelpMessage = "The resource group name.")]
29+
[ValidateNotNullOrEmpty]
30+
public string ResourceGroupName { get; set; }
31+
32+
[Alias("ResourceName", "AvailabilitySetName")]
33+
[Parameter(
34+
Position = 1,
35+
ValueFromPipelineByPropertyName = true,
36+
HelpMessage = "The availability set name.")]
37+
[ValidateNotNullOrEmpty]
38+
public string Name { get; set; }
39+
2440
public override void ExecuteCmdlet()
2541
{
2642
base.ExecuteCmdlet();

src/ResourceManager/Compute/Commands.Compute/Common/ComputeClientBaseCmdlet.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace Microsoft.Azure.Commands.Compute
1818
{
1919
public abstract class ComputeClientBaseCmdlet : AzurePSCmdlet
2020
{
21+
protected const string VirtualMachineExtensionType = "Microsoft.Compute/virtualMachines/extensions";
22+
2123
private ComputeClient computeClient;
2224

2325
public ComputeClient ComputeClient

src/ResourceManager/Compute/Commands.Compute/Extension/CustomScript/GetAzureVMCustomScriptExtensionCommand.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@ public class GetAzureVMCustomScriptExtensionCommand : VirtualMachineExtensionBas
3131
{
3232
protected const string GetCustomScriptExtensionParamSetName = "GetCustomScriptExtension";
3333

34+
[Parameter(
35+
Mandatory = true,
36+
Position = 0,
37+
ValueFromPipelineByPropertyName = true,
38+
HelpMessage = "The resource group name.")]
39+
[ValidateNotNullOrEmpty]
40+
public string ResourceGroupName { get; set; }
41+
42+
[Alias("ResourceName")]
43+
[Parameter(
44+
Mandatory = true,
45+
Position = 1,
46+
ValueFromPipelineByPropertyName = true,
47+
HelpMessage = "The virtual machine name.")]
48+
[ValidateNotNullOrEmpty]
49+
public string VMName { get; set; }
50+
51+
[Alias("ExtensionName")]
52+
[Parameter(
53+
Mandatory = true,
54+
Position = 2,
55+
ValueFromPipelineByPropertyName = true,
56+
HelpMessage = "The extension name.")]
57+
[ValidateNotNullOrEmpty]
58+
public string Name { get; set; }
59+
3460
[Parameter(
3561
Position = 3,
3662
ValueFromPipelineByPropertyName = true,

src/ResourceManager/Compute/Commands.Compute/Extension/CustomScript/RemoveAzureVMCustomScriptExtensionCommand.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,31 @@ namespace Microsoft.Azure.Commands.Compute
2323
ProfileNouns.VirtualMachineCustomScriptExtension)]
2424
public class RemoveAzureVMCustomScriptExtensionCommand : VirtualMachineExtensionBaseCmdlet
2525
{
26+
[Parameter(
27+
Mandatory = true,
28+
Position = 0,
29+
ValueFromPipelineByPropertyName = true,
30+
HelpMessage = "The resource group name.")]
31+
[ValidateNotNullOrEmpty]
32+
public string ResourceGroupName { get; set; }
33+
34+
[Alias("ResourceName")]
35+
[Parameter(
36+
Mandatory = true,
37+
Position = 1,
38+
ValueFromPipelineByPropertyName = true,
39+
HelpMessage = "The virtual machine name.")]
40+
[ValidateNotNullOrEmpty]
41+
public string VMName { get; set; }
42+
43+
[Alias("ExtensionName")]
44+
[Parameter(
45+
Mandatory = true,
46+
Position = 2,
47+
ValueFromPipelineByPropertyName = true,
48+
HelpMessage = "The extension name.")]
49+
[ValidateNotNullOrEmpty]
50+
public string Name { get; set; }
2651

2752
[Parameter(HelpMessage = "To force the removal.")]
2853
[ValidateNotNullOrEmpty]

src/ResourceManager/Compute/Commands.Compute/Extension/CustomScript/SetAzureVMCustomScriptExtensionCommand.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,32 @@ public class SetAzureVMCustomScriptExtensionCommand : VirtualMachineExtensionBas
4848
private const string defaultPolicyStr = "Unrestricted";
4949
private const string policyFormatStr = "-ExecutionPolicy {0}";
5050

51+
[Parameter(
52+
Mandatory = true,
53+
Position = 0,
54+
ValueFromPipelineByPropertyName = true,
55+
HelpMessage = "The resource group name.")]
56+
[ValidateNotNullOrEmpty]
57+
public string ResourceGroupName { get; set; }
58+
59+
[Alias("ResourceName")]
60+
[Parameter(
61+
Mandatory = true,
62+
Position = 1,
63+
ValueFromPipelineByPropertyName = true,
64+
HelpMessage = "The virtual machine name.")]
65+
[ValidateNotNullOrEmpty]
66+
public string VMName { get; set; }
67+
68+
[Alias("ExtensionName")]
69+
[Parameter(
70+
Mandatory = true,
71+
Position = 2,
72+
ValueFromPipelineByPropertyName = true,
73+
HelpMessage = "The extension name.")]
74+
[ValidateNotNullOrEmpty]
75+
public string Name { get; set; }
76+
5177
[Alias("HandlerVersion", "Version")]
5278
[Parameter(
5379
Mandatory = false,

src/ResourceManager/Compute/Commands.Compute/Extension/GetAzureVMExtensionCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class GetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
2929
ValueFromPipelineByPropertyName = true,
3030
HelpMessage = "The resource group name.")]
3131
[ValidateNotNullOrEmpty]
32-
public override string ResourceGroupName { get; set; }
32+
public string ResourceGroupName { get; set; }
3333

3434
[Alias("ResourceName")]
3535
[Parameter(
@@ -38,7 +38,7 @@ public class GetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
3838
ValueFromPipelineByPropertyName = true,
3939
HelpMessage = "The virtual machine name.")]
4040
[ValidateNotNullOrEmpty]
41-
public override string VMName { get; set; }
41+
public string VMName { get; set; }
4242

4343
[Alias("ExtensionName")]
4444
[Parameter(
@@ -47,7 +47,7 @@ public class GetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
4747
ValueFromPipelineByPropertyName = true,
4848
HelpMessage = "The extension name.")]
4949
[ValidateNotNullOrEmpty]
50-
public override string Name { get; set; }
50+
public string Name { get; set; }
5151

5252
[Parameter(
5353
Position = 3,

src/ResourceManager/Compute/Commands.Compute/Extension/RemoveAzureVMExtensionCommand.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,32 @@ namespace Microsoft.Azure.Commands.Compute
2323
[OutputType(typeof(ComputeLongRunningOperationResponse))]
2424
public class RemoveAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
2525
{
26+
[Parameter(
27+
Mandatory = true,
28+
Position = 0,
29+
ValueFromPipelineByPropertyName = true,
30+
HelpMessage = "The resource group name.")]
31+
[ValidateNotNullOrEmpty]
32+
public string ResourceGroupName { get; set; }
33+
34+
[Alias("ResourceName")]
35+
[Parameter(
36+
Mandatory = true,
37+
Position = 1,
38+
ValueFromPipelineByPropertyName = true,
39+
HelpMessage = "The virtual machine name.")]
40+
[ValidateNotNullOrEmpty]
41+
public string VMName { get; set; }
42+
43+
[Alias("ExtensionName")]
44+
[Parameter(
45+
Mandatory = true,
46+
Position = 2,
47+
ValueFromPipelineByPropertyName = true,
48+
HelpMessage = "The extension name.")]
49+
[ValidateNotNullOrEmpty]
50+
public string Name { get; set; }
51+
2652
[Parameter(HelpMessage = "To force the removal.")]
2753
[ValidateNotNullOrEmpty]
2854
public SwitchParameter Force { get; set; }

src/ResourceManager/Compute/Commands.Compute/Extension/SetAzureVMExtensionCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
3636
ValueFromPipelineByPropertyName = true,
3737
HelpMessage = "The resource group name.")]
3838
[ValidateNotNullOrEmpty]
39-
public override string ResourceGroupName { get; set; }
39+
public string ResourceGroupName { get; set; }
4040

4141
[Alias("ResourceName")]
4242
[Parameter(
@@ -45,7 +45,7 @@ public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
4545
ValueFromPipelineByPropertyName = true,
4646
HelpMessage = "The virtual machine name.")]
4747
[ValidateNotNullOrEmpty]
48-
public override string VMName { get; set; }
48+
public string VMName { get; set; }
4949

5050
[Alias("ExtensionName")]
5151
[Parameter(
@@ -54,7 +54,7 @@ public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
5454
ValueFromPipelineByPropertyName = true,
5555
HelpMessage = "The extension name.")]
5656
[ValidateNotNullOrEmpty]
57-
public override string Name { get; set; }
57+
public string Name { get; set; }
5858

5959
[Parameter(
6060
Mandatory = true,

src/ResourceManager/Compute/Commands.Compute/Extension/VMAccess/GetAzureVMAccessExtension.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,32 @@ namespace Microsoft.Azure.Commands.Compute
2828
OutputType(typeof(VirtualMachineAccessExtensionContext))]
2929
public class GetAzureVMAccessExtensionCommand : VirtualMachineExtensionBaseCmdlet
3030
{
31+
[Parameter(
32+
Mandatory = true,
33+
Position = 0,
34+
ValueFromPipelineByPropertyName = true,
35+
HelpMessage = "The resource group name.")]
36+
[ValidateNotNullOrEmpty]
37+
public string ResourceGroupName { get; set; }
38+
39+
[Alias("ResourceName")]
40+
[Parameter(
41+
Mandatory = true,
42+
Position = 1,
43+
ValueFromPipelineByPropertyName = true,
44+
HelpMessage = "The virtual machine name.")]
45+
[ValidateNotNullOrEmpty]
46+
public string VMName { get; set; }
47+
48+
[Alias("ExtensionName")]
49+
[Parameter(
50+
Mandatory = true,
51+
Position = 2,
52+
ValueFromPipelineByPropertyName = true,
53+
HelpMessage = "The extension name.")]
54+
[ValidateNotNullOrEmpty]
55+
public string Name { get; set; }
56+
3157
[Parameter(
3258
Position = 3,
3359
ValueFromPipelineByPropertyName = true,

src/ResourceManager/Compute/Commands.Compute/Extension/VMAccess/RemoveAzureVMAccessExtension.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,32 @@ namespace Microsoft.Azure.Commands.Compute
2323
ProfileNouns.VirtualMachineAccessExtension)]
2424
public class RemoveAzureVMAccessExtensionCommand : VirtualMachineExtensionBaseCmdlet
2525
{
26+
[Parameter(
27+
Mandatory = true,
28+
Position = 0,
29+
ValueFromPipelineByPropertyName = true,
30+
HelpMessage = "The resource group name.")]
31+
[ValidateNotNullOrEmpty]
32+
public string ResourceGroupName { get; set; }
33+
34+
[Alias("ResourceName")]
35+
[Parameter(
36+
Mandatory = true,
37+
Position = 1,
38+
ValueFromPipelineByPropertyName = true,
39+
HelpMessage = "The virtual machine name.")]
40+
[ValidateNotNullOrEmpty]
41+
public string VMName { get; set; }
42+
43+
[Alias("ExtensionName")]
44+
[Parameter(
45+
Mandatory = true,
46+
Position = 2,
47+
ValueFromPipelineByPropertyName = true,
48+
HelpMessage = "The extension name.")]
49+
[ValidateNotNullOrEmpty]
50+
public string Name { get; set; }
51+
2652
[Parameter(HelpMessage = "To force the removal.")]
2753
[ValidateNotNullOrEmpty]
2854
public SwitchParameter Force { get; set; }

src/ResourceManager/Compute/Commands.Compute/Extension/VMAccess/SetAzureVMAccessExtension.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@ public class SetAzureVMAccessExtensionCommand : VirtualMachineExtensionBaseCmdle
3131
private const string userNameKey = "userName";
3232
private const string passwordKey = "password";
3333

34+
[Parameter(
35+
Mandatory = true,
36+
Position = 0,
37+
ValueFromPipelineByPropertyName = true,
38+
HelpMessage = "The resource group name.")]
39+
[ValidateNotNullOrEmpty]
40+
public string ResourceGroupName { get; set; }
41+
42+
[Alias("ResourceName")]
43+
[Parameter(
44+
Mandatory = true,
45+
Position = 1,
46+
ValueFromPipelineByPropertyName = true,
47+
HelpMessage = "The virtual machine name.")]
48+
[ValidateNotNullOrEmpty]
49+
public string VMName { get; set; }
50+
51+
[Alias("ExtensionName")]
52+
[Parameter(
53+
Mandatory = true,
54+
Position = 2,
55+
ValueFromPipelineByPropertyName = true,
56+
HelpMessage = "The extension name.")]
57+
[ValidateNotNullOrEmpty]
58+
public string Name { get; set; }
59+
3460
[Alias("HandlerVersion", "Version")]
3561
[Parameter(
3662
Mandatory = false,

0 commit comments

Comments
 (0)