File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
articles/virtual-machines/windows Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,8 @@ foreach ($disk in $vmDisks)
58
58
{
59
59
if ($disk.ManagedBy -eq $vm.Id)
60
60
{
61
- $diskUpdateConfig = New-AzDiskUpdateConfig –AccountType $storageType
62
- Update-AzDisk -DiskUpdate $diskUpdateConfig -ResourceGroupName $rgName `
63
- -DiskName $disk.Name
61
+ $disk.Sku = [Microsoft.Azure.Management.Compute.Models.DiskSku]::new($storageType)
62
+ $disk | Update-AzDisk
64
63
}
65
64
}
66
65
@@ -97,9 +96,8 @@ $vm.HardwareProfile.VmSize = $size
97
96
Update-AzVM -VM $vm -ResourceGroupName $rgName
98
97
99
98
# Update the storage type
100
- $diskUpdateConfig = New-AzDiskUpdateConfig -AccountType $storageType -DiskSizeGB $disk.DiskSizeGB
101
- Update-AzDisk -DiskUpdate $diskUpdateConfig -ResourceGroupName $rgName `
102
- -DiskName $disk.Name
99
+ $disk.Sku = [Microsoft.Azure.Management.Compute.Models.DiskSku]::new($storageType)
100
+ $disk | Update-AzDisk
103
101
104
102
Start-AzVM -ResourceGroupName $vm.ResourceGroupName -Name $vm.Name
105
103
```
@@ -142,9 +140,8 @@ Stop-AzVM -ResourceGroupName $vmResource.ResourceGroupName -Name $vmResource.Nam
142
140
$vm = Get-AzVM -ResourceGroupName $vmResource.ResourceGroupName -Name $vmResource.Name
143
141
144
142
# Update the storage type
145
- $diskUpdateConfig = New-AzDiskUpdateConfig -AccountType $storageType -DiskSizeGB $disk.DiskSizeGB
146
- Update-AzDisk -DiskUpdate $diskUpdateConfig -ResourceGroupName $rgName `
147
- -DiskName $disk.Name
143
+ $disk.Sku = [Microsoft.Azure.Management.Compute.Models.DiskSku]::new($storageType)
144
+ $disk | Update-AzDisk
148
145
149
146
Start-AzVM -ResourceGroupName $vm.ResourceGroupName -Name $vm.Name
150
147
```
You can’t perform that action at this time.
0 commit comments