You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sample PowerShell script creates a custom image from a Windows VHD file in DevTest Labs. To use the script, replace the parameter values under the `# Values to change` comment with your own values. You can get the `subscriptionId`, `labRg`, and `labName` values from the lab's main page in the Azure portal.
368
+
This sample PowerShell script creates a custom image in DevTest Labs from a Windows VHD file. The script requires a VHD file to be uploaded to the Azure Storage account for the lab.
369
369
370
+
To use the script, replace the parameter values under the `# Values to change` comment with your own values. You can get the `subscriptionId`, `labRg`, and `labName` values from the lab's main page in the Azure portal. Get the `vhdUri` value from the Azure Storage container where you uploaded the VHD file.
|[Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey)| Gets the access keys for an Azure Storage account. |
377
-
|[New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment)|Adds an Azure deployment to a resource group. |
376
+
|[Get-AzResource](/powershell/module/az.resources/get-azresource)| Gets resources such as the lab object and lab storage account. |
377
+
|[Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey)| Gets the access keys for the lab storage account. |
378
+
|[New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment)|Creates the custom image and resource group deployment based on a template. |
378
379
379
380
```powershell
380
381
# Values to change
381
-
$subscriptionId = '<Specify your subscription ID here>'
382
-
$labRg = '<Specify your lab resource group name here>'
383
-
$labName = '<Specify your lab name here>'
384
-
$vhdUri = '<Specify the VHD URI here>'
385
-
$customImageName = '<Specify the custom image name>'
386
-
$customImageDescription = '<Specify the custom image description>'
387
-
388
-
# Select the desired Azure subscription.
382
+
$subscriptionId = '<Azure subscription ID>'
383
+
$labRg = '<Lab resource group name>'
384
+
$labName = '<Lab name>'
385
+
$vhdUri = '<VHD URI>'
386
+
$customImageName = '<Name for the custom image>'
387
+
$customImageDescription = '<Description for the custom image'
0 commit comments