Skip to content

Commit 6cd68c9

Browse files
author
James Brundage
committed
New-PipeScript: Adding inline documentation.
1 parent 5b3ce75 commit 6cd68c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

New-PipeScript.ps1.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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)]"

0 commit comments

Comments
 (0)