Skip to content

Commit 76afe67

Browse files
committed
Added PS command to retrieve the list of SKUs
1 parent c9e82cf commit 76afe67

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

articles/lab-services/quick-create-lab-powershell.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ We'll choose the Windows 11 image.
5353
$image = $plan | Get-AzLabServicesPlanImage | Where-Object { $_.EnabledState.ToString() -eq "enabled" -and $_.DisplayName -eq "Windows 11 Pro (Gen2)" }
5454
```
5555

56-
We're now ready to create a lab based of our lab plan with the Window 11 Pro image. The following command will create a lab using the lab plan created above.
56+
When you create a lab by using PowerShell, you also need to provide the resource SKU information. The following command uses the [REST API to retrieve the list of SKUs](/rest/api/labservices/skus/list):
57+
58+
```powershell
59+
$subscriptionId = (Get-AzContext).Subscription.ID
60+
(Invoke-AzRestMethod -Uri https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.LabServices/skus?api-version=2022-08-01 | Select-Object -Property "Content" -ExpandProperty Content | ConvertFrom-Json).value.name | Get-Unique
61+
```
62+
63+
We're now ready to create a lab based of our lab plan with the Window 11 Pro image and the `Classic_Fsv2_4_8GB_128_S_SSD` resource SKU. The following command will create a lab using the lab plan created above.
5764

5865
``` powershell
5966
# $plan and $image are from the Create LabPlan QuickStart.

0 commit comments

Comments
 (0)