@@ -48,7 +48,7 @@ public class NewAzureSynapseSparkPool : SynapseCmdletBase
48
48
[ ValidateNotNull ]
49
49
public Hashtable Tag { get ; set ; }
50
50
51
- [ Parameter ( ValueFromPipelineByPropertyName = false , Mandatory = true ,
51
+ [ Parameter ( ValueFromPipelineByPropertyName = false , Mandatory = false ,
52
52
HelpMessage = HelpMessages . NodeCount ) ]
53
53
[ ValidateRange ( 3 , 200 ) ]
54
54
public int NodeCount { get ; set ; }
@@ -139,7 +139,17 @@ public override void ExecuteCmdlet()
139
139
throw new SynapseException ( string . Format ( Resources . WorkspaceDoesNotExist , this . WorkspaceName ) ) ;
140
140
}
141
141
142
- LibraryRequirements libraryRequirements = null ;
142
+ // NodeCount and EnableAutoScale are given at the same time
143
+ if ( this . NodeCount != 0 && EnableAutoScale . IsPresent )
144
+ {
145
+ throw new SynapseException ( string . Format ( "" , "" ) ) ;
146
+ }
147
+ // both NodeCount and EnableAutoScale are not given
148
+ if ( this . NodeCount == 0 && ! EnableAutoScale . IsPresent ) {
149
+ throw new SynapseException ( string . Format ( "" , "" ) ) ;
150
+ }
151
+
152
+ LibraryRequirements libraryRequirements = null ;
143
153
if ( this . IsParameterBound ( c => c . LibraryRequirementsFilePath ) )
144
154
{
145
155
var powerShellDestinationPath = SessionState . Path . GetUnresolvedProviderPathFromPSPath ( LibraryRequirementsFilePath ) ;
@@ -155,7 +165,10 @@ public override void ExecuteCmdlet()
155
165
{
156
166
Location = existingWorkspace . Location ,
157
167
Tags = TagsConversionHelper . CreateTagDictionary ( this . Tag , validate : true ) ,
158
- NodeCount = this . NodeCount ,
168
+ //NodeCount = this.NodeCount,
169
+
170
+ NodeCount = EnableAutoScale . IsPresent ? ( int ? ) null : this . NodeCount ,
171
+
159
172
NodeSizeFamily = NodeSizeFamily . MemoryOptimized ,
160
173
NodeSize = NodeSize ,
161
174
AutoScale = ! EnableAutoScale . IsPresent ? null : new AutoScaleProperties
0 commit comments