Created
September 13, 2026 19:51
-
-
Save kostakoff/99fece7a7dbd2e4e3b2a883cd0a6a20f to your computer and use it in GitHub Desktop.
New-AzAksNodePool with hypervisor type UseWindowsGen2VM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $rgName = "my-rg" | |
| $cluster = "my-aks" | |
| $nodepoolname = "scale" | |
| $subscription = "00000000-0000-0000-0000-000000000000" | |
| $vnetName = "my-vnet" | |
| $aksSubnetName = "aks-subnet" | |
| $tenantId = "00000000-0000-0000-0000-000000000000" | |
| # Устанавливаем контекст — используем tenantId | |
| Set-AzContext -TenantId $tenantId -SubscriptionId $subscription | |
| $customHeader = @{ "UseWindowsGen2VM" = [string[]]("true") } | |
| New-AzAksNodePool ` | |
| -ResourceGroupName $rgName ` | |
| -ClusterName $cluster ` | |
| -Name $nodepoolname ` | |
| -VmSetType "VirtualMachineScaleSets" ` | |
| -Count 1 ` | |
| -VmSize "Standard_F4as_v6" ` | |
| -OsType "Windows" ` | |
| -OsSku "Windows2022" ` | |
| -AksCustomHeader $customHeader ` | |
| -VnetSubnetID "/subscriptions/$subscription/resourceGroups/$rgName/providers/Microsoft.Network/virtualNetworks/$vnetName/subnets/$aksSubnetName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment