@@ -4,7 +4,7 @@ description: In this article, you create a Windows VM by using the VM Image Buil
4
4
author : kof-f
5
5
ms.author : kofiforson
6
6
ms.reviewer : cynthn
7
- ms.date : 03/02/2021
7
+ ms.date : 09/12/2022
8
8
ms.topic : how-to
9
9
ms.service : virtual-machines
10
10
ms.subservice : image-builder
@@ -13,7 +13,7 @@ ms.custom: devx-track-azurepowershell
13
13
---
14
14
# Create a Windows VM with VM Image Builder by using PowerShell
15
15
16
- ** Applies to:** :heavy_check_mark : Windows VMs
16
+ ** Applies to:** :heavy_check_mark : Windows VMs
17
17
18
18
This article demonstrates how to create a customized Windows VM image by using the Azure VM Image
19
19
Builder PowerShell module.
@@ -190,7 +190,7 @@ Grant Azure image builder permissions to create images in the specified resource
190
190
Sku = '2019-Datacenter'
191
191
Version = 'latest'
192
192
}
193
- $srcPlatform = New-AzImageBuilderSourceObject @SrcObjParams
193
+ $srcPlatform = New-AzImageBuilderTemplateSourceObject @SrcObjParams
194
194
```
195
195
196
196
1 . Create a VM Image Builder distributor object.
@@ -204,7 +204,7 @@ Grant Azure image builder permissions to create images in the specified resource
204
204
RunOutputName = $runOutputName
205
205
ExcludeFromLatest = $false
206
206
}
207
- $disSharedImg = New-AzImageBuilderDistributorObject @disObjParams
207
+ $disSharedImg = New-AzImageBuilderTemplateDistributorObject @disObjParams
208
208
```
209
209
210
210
1 . Create a VM Image Builder customization object.
@@ -216,7 +216,7 @@ Grant Azure image builder permissions to create images in the specified resource
216
216
RunElevated = $false
217
217
Inline = @("mkdir c:\\buildActions", "mkdir c:\\buildArtifacts", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt")
218
218
}
219
- $Customizer01 = New-AzImageBuilderCustomizerObject @ImgCustomParams01
219
+ $Customizer01 = New-AzImageBuilderTemplateCustomizerObject @ImgCustomParams01
220
220
```
221
221
222
222
1 . Create a second VM Image Builder customization object.
@@ -228,7 +228,7 @@ Grant Azure image builder permissions to create images in the specified resource
228
228
Destination = 'c:\\buildArtifacts\\index.html'
229
229
SourceUri = 'https://raw.githubusercontent.com/azure/azvmimagebuilder/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html'
230
230
}
231
- $Customizer02 = New-AzImageBuilderCustomizerObject @ImgCustomParams02
231
+ $Customizer02 = New-AzImageBuilderTemplateCustomizerObject @ImgCustomParams02
232
232
```
233
233
234
234
1 . Create a VM Image Builder template.
@@ -292,14 +292,14 @@ If you encounter errors, review [Troubleshoot Azure VM Image Builder failures](.
292
292
1 . Create the VM by using the image you created.
293
293
294
294
``` azurepowershell-interactive
295
- $ArtifactId = (Get-AzImageBuilderRunOutput -ImageTemplateName $imageTemplateName -ResourceGroupName $imageResourceGroup).ArtifactId
295
+ $ArtifactId = (Get-AzImageBuilderTemplateRunOutput -ImageTemplateName $imageTemplateName -ResourceGroupName $imageResourceGroup).ArtifactId
296
296
297
297
New-AzVM -ResourceGroupName $imageResourceGroup -Image $ArtifactId -Name myWinVM01 -Credential $Cred
298
298
```
299
299
300
300
## Verify the customizations
301
301
302
- 1 . Create a Remote Desktop connection to the VM by using the username and password that you set when you created the VM.
302
+ 1 . Create a Remote Desktop connection to the VM by using the username and password that you set when you created the VM.
303
303
304
304
1 . Inside the VM, open PowerShell and run ` Get-Content ` , as shown in the following example:
305
305
0 commit comments