Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Aks/Aks/Commands/NewAzureRmAksNodePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.Azure.Commands.Aks.Models;
using Microsoft.Azure.Commands.Aks.Properties;
Expand Down Expand Up @@ -81,6 +82,10 @@ public class NewAzureRmAksNodePool : NewOrUpdateAgentPoolBase
[PSArgumentCompleter("AvailabilitySet", "VirtualMachineScaleSets")]
public string VmSetType { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Represents type of windows os type. Possible values include: 'aks-windows-2004'")]
[PSArgumentCompleter("aks-windows-2004")]
public string WindowsOSType { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Create node pool even if it already exists")]
public SwitchParameter Force { get; set; }

Expand All @@ -99,7 +104,15 @@ public override void ExecuteCmdlet()
ClusterName = ClusterObject.Name;
}
var agentPool = GetAgentPool();
var pool = Client.AgentPools.CreateOrUpdate(ResourceGroupName, ClusterName, Name, agentPool);
Dictionary<string, List<string>> customHeaders = null;
if (this.IsParameterBound(c => c.WindowsOSType))
{
customHeaders = new Dictionary<string, List<string>>
{
{ "CustomizedWindows", new List<string> { WindowsOSType } }
};
}
var pool = Client.AgentPools.CreateOrUpdateWithHttpMessagesAsync(ResourceGroupName, ClusterName, Name, agentPool, customHeaders).GetAwaiter().GetResult().Body;
var psPool = PSMapper.Instance.Map<PSNodePool>(pool);
WriteObject(psPool);
};
Expand Down