File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -345,15 +345,21 @@ HTTP Accept indicates what content types the web request will accept as a respon
345345 $allEndBlocks += $end
346346 }
347347
348+ # If -AutoParameter was passed
348349 if ($AutoParameter ) {
350+ # Find all of the variable expressions within -Begin, -Process, and -End
349351 $variableDefinitions = $Begin , $Process , $End |
350352 Where-Object { $_ } |
351353 Search-PipeScript - AstType VariableExpressionAST |
352354 Select-Object - ExpandProperty Result
353355 foreach ($var in $variableDefinitions ) {
356+ # Then, see where those variables were assigned
354357 $assigned = $var.GetAssignments ()
358+ # (if they were assigned, keep moving)
355359 if ($assigned ) { continue }
360+ # If there were not assigned
356361 $varName = $var.VariablePath.userPath.ToString ()
362+ # add it to the list of parameters to create.
357363 $ParametersToCreate [$varName ] = @ (
358364 @ (
359365 " [Parameter(ValueFromPipelineByPropertyName)]"
You can’t perform that action at this time.
0 commit comments