@@ -21,12 +21,15 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS
21
21
{
22
22
[ Cmdlet (
23
23
VerbsCommon . Set ,
24
- AzureDataDiskConfigurationNoun ) ,
24
+ AzureDataDiskConfigurationNoun ,
25
+ DefaultParameterSetName = UpdateAzureVMImageParamSet ) ,
25
26
OutputType (
26
27
typeof ( VirtualMachineImageDiskConfigSet ) ) ]
27
28
public class SetAzureVMImageDataDiskConfig : PSCmdlet
28
29
{
29
30
protected const string AzureDataDiskConfigurationNoun = "AzureVMImageDataDiskConfig" ;
31
+ protected const string UpdateAzureVMImageParamSet = "UpdateAzureVMImageParamSet" ;
32
+ protected const string AddAzureVMImageParamSet = "AddAzureVMImageParamSet" ;
30
33
31
34
[ Parameter (
32
35
Position = 0 ,
@@ -38,6 +41,7 @@ public class SetAzureVMImageDataDiskConfig : PSCmdlet
38
41
public VirtualMachineImageDiskConfigSet DiskConfig { get ; set ; }
39
42
40
43
[ Parameter (
44
+ ParameterSetName = UpdateAzureVMImageParamSet ,
41
45
Position = 1 ,
42
46
Mandatory = true ,
43
47
ValueFromPipelineByPropertyName = true ,
@@ -46,38 +50,45 @@ public class SetAzureVMImageDataDiskConfig : PSCmdlet
46
50
public string DataDiskName { get ; set ; }
47
51
48
52
[ Parameter (
53
+ ParameterSetName = UpdateAzureVMImageParamSet ,
49
54
Position = 2 ,
50
55
Mandatory = true ,
51
56
ValueFromPipelineByPropertyName = true ,
52
57
HelpMessage = "Lun" ) ]
58
+ [ Parameter (
59
+ ParameterSetName = AddAzureVMImageParamSet ,
60
+ Position = 1 ,
61
+ Mandatory = true ,
62
+ ValueFromPipelineByPropertyName = true ,
63
+ HelpMessage = "Lun" ) ]
53
64
[ ValidateNotNullOrEmpty ]
54
65
public int Lun { get ; set ; }
55
66
56
67
[ Parameter (
68
+ ParameterSetName = UpdateAzureVMImageParamSet ,
57
69
Position = 3 ,
58
70
Mandatory = true ,
59
71
ValueFromPipelineByPropertyName = true ,
60
72
HelpMessage = "Controls the platform caching behavior of the data disk blob for read efficiency." ) ]
73
+ [ Parameter (
74
+ ParameterSetName = AddAzureVMImageParamSet ,
75
+ Position = 2 ,
76
+ Mandatory = true ,
77
+ ValueFromPipelineByPropertyName = true ,
78
+ HelpMessage = "Controls the platform caching behavior of the data disk blob for read efficiency." ) ]
61
79
[ ValidateNotNullOrEmpty ]
62
80
[ ValidateSet ( "ReadOnly" , "ReadWrite" , "None" , IgnoreCase = true ) ]
63
81
public string HostCaching { get ; set ; }
64
82
65
83
[ Parameter (
66
- Position = 4 ,
67
- Mandatory = false ,
84
+ ParameterSetName = AddAzureVMImageParamSet ,
85
+ Position = 3 ,
86
+ Mandatory = true ,
68
87
ValueFromPipelineByPropertyName = true ,
69
88
HelpMessage = "The media link." ) ]
70
89
[ ValidateNotNullOrEmpty ]
71
90
public Uri MediaLink { get ; set ; }
72
91
73
- [ Parameter (
74
- Position = 5 ,
75
- Mandatory = false ,
76
- ValueFromPipelineByPropertyName = true ,
77
- HelpMessage = "The logical disk size in GB." ) ]
78
- [ ValidateNotNullOrEmpty ]
79
- public int LogicalDiskSizeInGB { get ; set ; }
80
-
81
92
protected override void ProcessRecord ( )
82
93
{
83
94
ServiceManagementProfile . Initialize ( ) ;
@@ -100,7 +111,6 @@ protected override void ProcessRecord()
100
111
diskConfig . HostCaching = this . HostCaching ;
101
112
diskConfig . Lun = this . Lun ;
102
113
diskConfig . MediaLink = this . MediaLink ;
103
- diskConfig . LogicalDiskSizeInGB = this . LogicalDiskSizeInGB ;
104
114
105
115
WriteObject ( DiskConfig ) ;
106
116
}
0 commit comments