Skip to content

Commit 161ab9b

Browse files
Merge pull request #210857 from mikefrobbins/mr-azps-1987104
Updates to reflect changes in az.imagebuilder v0.3.0
2 parents 5c963d0 + 157004b commit 161ab9b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

articles/virtual-machines/windows/image-builder-powershell.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: In this article, you create a Windows VM by using the VM Image Buil
44
author: kof-f
55
ms.author: kofiforson
66
ms.reviewer: cynthn
7-
ms.date: 03/02/2021
7+
ms.date: 09/12/2022
88
ms.topic: how-to
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -13,7 +13,7 @@ ms.custom: devx-track-azurepowershell
1313
---
1414
# Create a Windows VM with VM Image Builder by using PowerShell
1515

16-
**Applies to:** :heavy_check_mark: Windows VMs
16+
**Applies to:** :heavy_check_mark: Windows VMs
1717

1818
This article demonstrates how to create a customized Windows VM image by using the Azure VM Image
1919
Builder PowerShell module.
@@ -190,7 +190,7 @@ Grant Azure image builder permissions to create images in the specified resource
190190
Sku = '2019-Datacenter'
191191
Version = 'latest'
192192
}
193-
$srcPlatform = New-AzImageBuilderSourceObject @SrcObjParams
193+
$srcPlatform = New-AzImageBuilderTemplateSourceObject @SrcObjParams
194194
```
195195

196196
1. Create a VM Image Builder distributor object.
@@ -204,7 +204,7 @@ Grant Azure image builder permissions to create images in the specified resource
204204
RunOutputName = $runOutputName
205205
ExcludeFromLatest = $false
206206
}
207-
$disSharedImg = New-AzImageBuilderDistributorObject @disObjParams
207+
$disSharedImg = New-AzImageBuilderTemplateDistributorObject @disObjParams
208208
```
209209

210210
1. Create a VM Image Builder customization object.
@@ -216,7 +216,7 @@ Grant Azure image builder permissions to create images in the specified resource
216216
RunElevated = $false
217217
Inline = @("mkdir c:\\buildActions", "mkdir c:\\buildArtifacts", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt")
218218
}
219-
$Customizer01 = New-AzImageBuilderCustomizerObject @ImgCustomParams01
219+
$Customizer01 = New-AzImageBuilderTemplateCustomizerObject @ImgCustomParams01
220220
```
221221

222222
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
228228
Destination = 'c:\\buildArtifacts\\index.html'
229229
SourceUri = 'https://raw.githubusercontent.com/azure/azvmimagebuilder/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html'
230230
}
231-
$Customizer02 = New-AzImageBuilderCustomizerObject @ImgCustomParams02
231+
$Customizer02 = New-AzImageBuilderTemplateCustomizerObject @ImgCustomParams02
232232
```
233233

234234
1. Create a VM Image Builder template.
@@ -292,14 +292,14 @@ If you encounter errors, review [Troubleshoot Azure VM Image Builder failures](.
292292
1. Create the VM by using the image you created.
293293

294294
```azurepowershell-interactive
295-
$ArtifactId = (Get-AzImageBuilderRunOutput -ImageTemplateName $imageTemplateName -ResourceGroupName $imageResourceGroup).ArtifactId
295+
$ArtifactId = (Get-AzImageBuilderTemplateRunOutput -ImageTemplateName $imageTemplateName -ResourceGroupName $imageResourceGroup).ArtifactId
296296
297297
New-AzVM -ResourceGroupName $imageResourceGroup -Image $ArtifactId -Name myWinVM01 -Credential $Cred
298298
```
299299

300300
## Verify the customizations
301301

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.
303303

304304
1. Inside the VM, open PowerShell and run `Get-Content`, as shown in the following example:
305305

0 commit comments

Comments
 (0)