1313// ----------------------------------------------------------------------------------
1414
1515using System ;
16+ using System . Collections . Generic ;
1617using System . Management . Automation ;
1718using Microsoft . Azure . Commands . Aks . Models ;
1819using Microsoft . Azure . Commands . Aks . Properties ;
@@ -81,6 +82,10 @@ public class NewAzureRmAksNodePool : NewOrUpdateAgentPoolBase
8182 [ PSArgumentCompleter ( "AvailabilitySet" , "VirtualMachineScaleSets" ) ]
8283 public string VmSetType { get ; set ; }
8384
85+ [ Parameter ( Mandatory = false , HelpMessage = "Represents type of windows os type. Possible values include: 'aks-windows-2004'" ) ]
86+ [ PSArgumentCompleter ( "aks-windows-2004" ) ]
87+ public string WindowsOSType { get ; set ; }
88+
8489 [ Parameter ( Mandatory = false , HelpMessage = "Create node pool even if it already exists" ) ]
8590 public SwitchParameter Force { get ; set ; }
8691
@@ -99,7 +104,15 @@ public override void ExecuteCmdlet()
99104 ClusterName = ClusterObject . Name ;
100105 }
101106 var agentPool = GetAgentPool ( ) ;
102- var pool = Client . AgentPools . CreateOrUpdate ( ResourceGroupName , ClusterName , Name , agentPool ) ;
107+ Dictionary < string , List < string > > customHeaders = null ;
108+ if ( this . IsParameterBound ( c => c . WindowsOSType ) )
109+ {
110+ customHeaders = new Dictionary < string , List < string > >
111+ {
112+ { "CustomizedWindows" , new List < string > { WindowsOSType } }
113+ } ;
114+ }
115+ var pool = Client . AgentPools . CreateOrUpdateWithHttpMessagesAsync ( ResourceGroupName , ClusterName , Name , agentPool , customHeaders ) . GetAwaiter ( ) . GetResult ( ) . Body ;
103116 var psPool = PSMapper . Instance . Map < PSNodePool > ( pool ) ;
104117 WriteObject ( psPool ) ;
105118 } ;
0 commit comments