File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -249,8 +249,6 @@ public bool PositionalParameterUsed(CommandAst cmdAst)
249
249
CommandInfo commandInfo = GetCommandInfo ( GetCmdletNameFromAlias ( cmdAst . GetCommandName ( ) ) ) ?? GetCommandInfo ( cmdAst . GetCommandName ( ) ) ;
250
250
251
251
IEnumerable < ParameterMetadata > switchParams = null ;
252
- IEnumerable < CommandParameterSetInfo > scriptBlocks = null ;
253
- bool hasScriptBlockSet = false ;
254
252
255
253
if ( HasSplattedVariable ( cmdAst ) )
256
254
{
@@ -262,15 +260,6 @@ public bool PositionalParameterUsed(CommandAst cmdAst)
262
260
try
263
261
{
264
262
switchParams = commandInfo . Parameters . Values . Where < ParameterMetadata > ( pm => pm . SwitchParameter ) ;
265
- scriptBlocks = commandInfo . ParameterSets ;
266
- foreach ( CommandParameterSetInfo cmdParaset in scriptBlocks )
267
- {
268
- if ( String . Equals ( cmdParaset . Name , "ScriptBlockSet" , StringComparison . OrdinalIgnoreCase ) )
269
- {
270
- hasScriptBlockSet = true ;
271
- }
272
- }
273
-
274
263
}
275
264
catch ( Exception )
276
265
{
@@ -284,8 +273,6 @@ public bool PositionalParameterUsed(CommandAst cmdAst)
284
273
285
274
foreach ( CommandElementAst ceAst in cmdAst . CommandElements )
286
275
{
287
- if ( ! hasScriptBlockSet )
288
- {
289
276
if ( ceAst is CommandParameterAst )
290
277
{
291
278
// Skip if it's a switch parameter
@@ -308,7 +295,7 @@ public bool PositionalParameterUsed(CommandAst cmdAst)
308
295
{
309
296
arguments += 1 ;
310
297
}
311
- }
298
+
312
299
}
313
300
314
301
// if not the first element in a pipeline, increase the number of arguments by 1
You can’t perform that action at this time.
0 commit comments