Skip to content

Commit 7fec93d

Browse files
committed
Change VhdUri to Mandatory since this is required.
1 parent 50abf13 commit 7fec93d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Config/AddAzureVMDataDiskCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class AddAzureVMDataDiskCommand : Microsoft.Azure.Commands.ResourceManage
4747
public string Name { get; set; }
4848

4949
[Parameter(
50-
Mandatory = false,
50+
Mandatory = true,
5151
Position = 2,
5252
ValueFromPipelineByPropertyName = true,
5353
HelpMessage = HelpMessages.VMDataDiskVhdUri)]
@@ -115,8 +115,8 @@ protected override void ProcessRecord()
115115
Name = this.Name,
116116
Caching = this.Caching,
117117
DiskSizeGB = this.DiskSizeInGB,
118-
Lun = this.Lun == null ? 0 : this.Lun.Value,
119-
VirtualHardDisk = string.IsNullOrEmpty(this.VhdUri) ? null : new VirtualHardDisk
118+
Lun = this.Lun.GetValueOrDefault(),
119+
VirtualHardDisk = new VirtualHardDisk
120120
{
121121
Uri = this.VhdUri
122122
},

0 commit comments

Comments
 (0)