Skip to content

Commit c1ddb20

Browse files
Merge pull request #281665 from lilyychen96/patch-2
fix PowerShell script for determining VM + region availability
2 parents be24f50 + d30e43f commit c1ddb20

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/virtual-machines/disks-enable-ultra-ssd.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ az vm list-skus --resource-type virtualMachines --location $region --query "[?na
4343

4444
```powershell
4545
# Example value is southeastasia
46-
region = "<yourLocation>"
46+
$region = "<yourLocation>"
4747
# Example value is Standard_E64s_v3
48-
vmSize = "<yourVMSize>"
49-
$sku = (Get-AzComputeResourceSku | where {$_.Locations.Contains($region) -and ($_.Name -eq $vmSize) -and $_.LocationInfo[0].ZoneDetails.Count -gt 0})
48+
$vmSize = "<yourVMSize>"
49+
$sku = (Get-AzComputeResourceSku | where {$_.Locations -icontains($region) -and ($_.Name -eq $vmSize) -and $_.LocationInfo[0].ZoneDetails.Count -gt 0})
5050
if($sku){$sku[0].LocationInfo[0].ZoneDetails} Else {Write-host "$vmSize is not supported with Ultra Disk in $region region"}
5151
```
5252

@@ -79,10 +79,10 @@ az vm list-skus --resource-type virtualMachines --location $region --query "[?na
7979

8080
```powershell
8181
# Example value is westus
82-
region = "<yourLocation>"
82+
$region = "<yourLocation>"
8383
# Example value is Standard_E64s_v3
84-
vmSize = "<yourVMSize>"
85-
(Get-AzComputeResourceSku | where {$_.Locations.Contains($region) -and ($_.Name -eq $vmSize) })[0].Capabilities
84+
$vmSize = "<yourVMSize>"
85+
(Get-AzComputeResourceSku | where {$_.Locations -icontains($region) -and ($_.Name -eq $vmSize) })[0].Capabilities
8686
```
8787

8888
The response will be similar to the following form, `UltraSSDAvailable True` indicates whether the VM size supports Ultra Disks in this region.

0 commit comments

Comments
 (0)