Reputation: 3
Deploying the ARM Template using the Powershell, need to fetch the previous AVD Session host number from Azure Portal and from which we can pass the next incremental value in the ARM template by declaring a variable.
#Login-AzAccount
$vminitialnumber= Get-AzWvdSessionHost -HostPoolName infosyswvd -ResourceGroupName avd
New-AzResourceGroupDeployment `
-ResourceGroupName AVD `
-TemplateFile 'D:\Updated-AVD\East US\Template.json' `
-TemplateParameterFile 'D:\Updated-AVD\East US\Parameters.json'
Upvotes: 0
Views: 1024
Reputation: 4776
Install-Module Az.Avd
Import-Module Az.Avd
Use the Get-AvdLatestSessionHost to get the Latest Session Host.
Get-AvdLatestSessionHost -HostpoolName <String> -ResourceGroupName <String> [-NumOnly] [<CommonParameters>]
Get-AvdLatestSessionHost -HostpoolName <Your Host Pool Name> ResourceGroupName <Your Resource Group Name>
Refer this blog to get the session Recent/Old Session Host using the Get-AvdImageVersionStatus Command.
Upvotes: 0