Skip to content

Commit 2b776a2

Browse files
authored
Merge pull request #3870 from hyonholee/dev
[AzureRT] May update
2 parents 9d95903 + f8ff347 commit 2b776a2

File tree

16 files changed

+93
-57
lines changed

16 files changed

+93
-57
lines changed

src/ResourceManager/Compute/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
* Updated Set-AzureRmVMAEMExtension and Test-AzureRmVMAEMExtension cmdlets to support Premium managed disks
2323
* Backup encryption settings for IaaS VMs and restore on failure
2424
* ChefServiceInterval option is renamed to ChefDaemonInterval now. Old one will continue to work however.
25+
* Remove duplicated DataDiskNames and NetworkInterfaceIDs properties from PS VM object.
26+
- Make DataDiskNames and NetworkInterfaceIDs parameters optional in Remove-AzureRmVMDataDisk and Remove-AzureRmVMNetworkInterface, respectively.
27+
* Fix the piping issue of Get cmdlets when the Get cmdlets return a list object.
2528

2629
## Version 2.9.0
2730

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineProfileTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function Test-VirtualMachineProfile
6666
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3' -Caching 'ReadOnly' -DiskSizeInGB $null -Lun 2 -VhdUri $dataDiskVhdUri3 -CreateOption Empty;
6767
Assert-Null $p.StorageProfile.DataDisks[2].DiskSizeGB;
6868
$p = Remove-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3';
69-
69+
7070
Assert-AreEqual $p.StorageProfile.OSDisk.Caching $osDiskCaching;
7171
Assert-AreEqual $p.StorageProfile.OSDisk.Name $osDiskName;
7272
Assert-AreEqual $p.StorageProfile.OSDisk.Vhd.Uri $osDiskVhdUri;

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,10 @@ function Test-VirtualMachineScaleSetLB
527527

528528
# List All
529529
Write-Verbose ('Running Command : ' + 'Get-AzureRmVmss ListAll');
530-
$vmssList = Get-AzureRmVmss;
530+
$vmssList = Get-AzureRmVmss | ? Name -like 'vmsscrptestps*';
531531
Assert-True { ($vmssList | select -ExpandProperty Name) -contains $vmssName };
532532
$output = $vmssList | Out-String;
533+
Assert-AreEqual 1 $vmssList.Count
533534
Write-Verbose ($output);
534535
Assert-False { $output.Contains("VirtualMachineProfile") };
535536

@@ -624,7 +625,7 @@ function Test-VirtualMachineScaleSetNextLink
624625

625626
$result = New-AzureRmVmss -ResourceGroupName $rgname -Name $vmssName -VirtualMachineScaleSet $vmss;
626627

627-
$vmssVmResult = Get-AzureRmVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName;
628+
$vmssVmResult = Get-AzureRmVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName | ? Name -like 'vmsscrptestps*';
628629
Assert-AreEqual $vmss_number $vmssVmResult.Count
629630
}
630631
finally

src/ResourceManager/Compute/Commands.Compute/Generated/AvailabilitySet/AvailabilitySetGetMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected void ExecuteAvailabilitySetGetMethod(object[] invokeMethodInputParamet
9696
{
9797
psObject.Add(Mapper.Map<AvailabilitySet, PSAvailabilitySetList>(r));
9898
}
99-
WriteObject(psObject);
99+
WriteObject(psObject, true);
100100
}
101101
}
102102

src/ResourceManager/Compute/Commands.Compute/Generated/ContainerService/ContainerServiceGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParame
106106
{
107107
psObject.Add(Mapper.Map<ContainerService, PSContainerServiceList>(r));
108108
}
109-
WriteObject(psObject);
109+
WriteObject(psObject, true);
110110
}
111111
else
112112
{
@@ -127,7 +127,7 @@ protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParame
127127
{
128128
psObject.Add(Mapper.Map<ContainerService, PSContainerServiceList>(r));
129129
}
130-
WriteObject(psObject);
130+
WriteObject(psObject, true);
131131
}
132132
}
133133

src/ResourceManager/Compute/Commands.Compute/Generated/Disk/DiskGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected void ExecuteDiskGetMethod(object[] invokeMethodInputParameters)
106106
{
107107
psObject.Add(Mapper.Map<Disk, PSDiskList>(r));
108108
}
109-
WriteObject(psObject);
109+
WriteObject(psObject, true);
110110
}
111111
else
112112
{
@@ -127,7 +127,7 @@ protected void ExecuteDiskGetMethod(object[] invokeMethodInputParameters)
127127
{
128128
psObject.Add(Mapper.Map<Disk, PSDiskList>(r));
129129
}
130-
WriteObject(psObject);
130+
WriteObject(psObject, true);
131131
}
132132
}
133133

src/ResourceManager/Compute/Commands.Compute/Generated/Image/ImageGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected void ExecuteImageGetMethod(object[] invokeMethodInputParameters)
119119
{
120120
psObject.Add(Mapper.Map<Image, PSImageList>(r));
121121
}
122-
WriteObject(psObject);
122+
WriteObject(psObject, true);
123123
}
124124
else
125125
{
@@ -140,7 +140,7 @@ protected void ExecuteImageGetMethod(object[] invokeMethodInputParameters)
140140
{
141141
psObject.Add(Mapper.Map<Image, PSImageList>(r));
142142
}
143-
WriteObject(psObject);
143+
WriteObject(psObject, true);
144144
}
145145
}
146146

src/ResourceManager/Compute/Commands.Compute/Generated/Snapshot/SnapshotGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected void ExecuteSnapshotGetMethod(object[] invokeMethodInputParameters)
106106
{
107107
psObject.Add(Mapper.Map<Snapshot, PSSnapshotList>(r));
108108
}
109-
WriteObject(psObject);
109+
WriteObject(psObject, true);
110110
}
111111
else
112112
{
@@ -127,7 +127,7 @@ protected void ExecuteSnapshotGetMethod(object[] invokeMethodInputParameters)
127127
{
128128
psObject.Add(Mapper.Map<Snapshot, PSSnapshotList>(r));
129129
}
130-
WriteObject(psObject);
130+
WriteObject(psObject, true);
131131
}
132132
}
133133

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachine/VirtualMachineGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected void ExecuteVirtualMachineGetMethod(object[] invokeMethodInputParamete
119119
{
120120
psObject.Add(Mapper.Map<VirtualMachine, PSVirtualMachineList>(r));
121121
}
122-
WriteObject(psObject);
122+
WriteObject(psObject, true);
123123
}
124124
else
125125
{
@@ -140,7 +140,7 @@ protected void ExecuteVirtualMachineGetMethod(object[] invokeMethodInputParamete
140140
{
141141
psObject.Add(Mapper.Map<VirtualMachine, PSVirtualMachineList>(r));
142142
}
143-
WriteObject(psObject);
143+
WriteObject(psObject, true);
144144
}
145145
}
146146

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetGetMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected void ExecuteVirtualMachineScaleSetGetMethod(object[] invokeMethodInput
106106
{
107107
psObject.Add(Mapper.Map<VirtualMachineScaleSet, PSVirtualMachineScaleSetList>(r));
108108
}
109-
WriteObject(psObject);
109+
WriteObject(psObject, true);
110110
}
111111
else
112112
{
@@ -127,7 +127,7 @@ protected void ExecuteVirtualMachineScaleSetGetMethod(object[] invokeMethodInput
127127
{
128128
psObject.Add(Mapper.Map<VirtualMachineScaleSet, PSVirtualMachineScaleSetList>(r));
129129
}
130-
WriteObject(psObject);
130+
WriteObject(psObject, true);
131131
}
132132
}
133133

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachineScaleSetVM/VirtualMachineScaleSetVMGetMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected void ExecuteVirtualMachineScaleSetVMGetMethod(object[] invokeMethodInp
119119
{
120120
psObject.Add(Mapper.Map<VirtualMachineScaleSetVM, PSVirtualMachineScaleSetVMList>(r));
121121
}
122-
WriteObject(psObject);
122+
WriteObject(psObject, true);
123123
}
124124
}
125125

src/ResourceManager/Compute/Commands.Compute/Models/PSVirtualMachine.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,6 @@ public string ResourceGroupName
9191
// Gets or sets the storage profile.
9292
public StorageProfile StorageProfile { get; set; }
9393

94-
[JsonIgnore]
95-
public string[] DataDiskNames
96-
{
97-
get
98-
{
99-
if (this.StorageProfile == null || this.StorageProfile.DataDisks == null) return null;
100-
var listStr = new List<string>();
101-
foreach (var item in StorageProfile.DataDisks)
102-
{
103-
listStr.Add(item.Name);
104-
}
105-
return listStr.ToArray();
106-
}
107-
}
108-
109-
[JsonIgnore]
110-
public string[] NetworkInterfaceIDs
111-
{
112-
get
113-
{
114-
if (this.NetworkProfile == null || this.NetworkProfile.NetworkInterfaces == null) return null;
115-
var listStr = new List<string>();
116-
foreach (var item in NetworkProfile.NetworkInterfaces)
117-
{
118-
listStr.Add(item.Id);
119-
}
120-
return listStr.ToArray();
121-
}
122-
}
123-
12494
public DisplayHintType DisplayHint { get; set; }
12595

12696
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public class RemoveAzureVMDataDiskCommand : Microsoft.Azure.Commands.ResourceMan
4040

4141
[Alias("Name")]
4242
[Parameter(
43-
Mandatory = true,
43+
Mandatory = false,
4444
Position = 1,
45-
ValueFromPipelineByPropertyName = true,
45+
ValueFromPipelineByPropertyName = false,
4646
HelpMessage = HelpMessages.VMDataDiskName)]
4747
[ValidateNotNullOrEmpty]
4848
public string[] DataDiskNames { get; set; }
@@ -51,8 +51,6 @@ public override void ExecuteCmdlet()
5151
{
5252
if (this.ShouldProcess("DataDisk", VerbsCommon.Remove))
5353
{
54-
WriteWarning("Breaking change notice: In upcoming release, DataDiskNames parameter will no longer support pipeline. This parameter will be optional. All data disks will be removed from a given VM object if a user does not give this parameter.");
55-
5654
var storageProfile = this.VM.StorageProfile;
5755

5856
if (storageProfile != null && storageProfile.DataDisks != null)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public class RemoveAzureVMNetworkInterfaceCommand : Microsoft.Azure.Commands.Res
4343

4444
[Alias("Id", "NicIds")]
4545
[Parameter(
46-
Mandatory = true,
46+
Mandatory = false,
4747
Position = 1,
48-
ValueFromPipelineByPropertyName = true,
48+
ValueFromPipelineByPropertyName = false,
4949
HelpMessage = HelpMessages.VMNetworkInterfaceID)]
5050
[ValidateNotNullOrEmpty]
5151
public string[] NetworkInterfaceIDs { get; set; }
@@ -54,8 +54,6 @@ public override void ExecuteCmdlet()
5454
{
5555
if (this.ShouldProcess("NetworkInterface", VerbsCommon.Remove))
5656
{
57-
WriteWarning("Breaking change notice: In upcoming release, NetworkInterfaceIDs will no longer support pipeline. This parameter will be optional. All network interfaces will be removed from a given VM object if a user does not give this parameter.");
58-
5957
var networkProfile = this.VM.NetworkProfile;
6058

6159
if (NetworkInterfaceIDs == null)

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation/GetAzureVMCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public override void ExecuteCmdlet()
8080
{
8181
base.ExecuteCmdlet();
8282

83-
WriteWarning("Breaking change notice: In upcoming release, top level properties, DataDiskNames and NetworkInterfaceIDs, will be removed from VM object because they are also in StorageProfile and NetworkProfile, respectively.");
84-
8583
ExecuteClientAction(() =>
8684
{
8785
if (string.IsNullOrEmpty(this.ResourceGroupName) && string.IsNullOrEmpty(this.Name))

0 commit comments

Comments
 (0)