Skip to content

Commit cf4045f

Browse files
authored
Merge pull request #3456 from hyonholee/vmoutputfix
Fix VM output bug when vm contains AvailabilitySet with Compact displ…
2 parents 74c7666 + f0b3115 commit cf4045f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ function Test-VirtualMachine
236236

237237
$vm2 = Get-AzureRmVM -Name $vmname2 -ResourceGroupName $rgname;
238238
Assert-NotNull $vm2;
239-
# Assert-AreEqual $vm2.AvailabilitySetReference.Id $asetId;
240-
# Assert-True { $vm2.ResourceGroupName -eq $rgname }
239+
$vm2_out = $vm2 | Out-String
240+
Assert-True {$vm2_out.Contains("AvailabilitySetReference")};
241+
Assert-AreEqual $vm2.AvailabilitySetReference.Id $asetId;
242+
Assert-True { $vm2.ResourceGroupName -eq $rgname }
241243

242244
# Remove
243245
Remove-AzureRmVM -Name $vmname2 -ResourceGroupName $rgname -Force;

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/VirtualMachineBaseCmdlet.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ private static int GetTabLength(Object obj, int max, int depth, List<Tuple<strin
186186
else
187187
{
188188
tupleList.Add(MakeTuple(property.Name, GetChildProperties(childObject), depth));
189+
max = Math.Max(max, property.Name.Length);
189190
}
190191
}
191192
}

0 commit comments

Comments
 (0)