File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,12 @@ function Join-PipeScript
143143 $lastParameter = $parameter.Parent.Parameters [$parameterIndex - 1 ]
144144 $relativeOffset = $lastParameter.Extent.EndOffset + 1 - $parameter.Parent.Extent.StartOffset
145145 $distance = $parameter.Extent.StartOffset - $lastParameter.Extent.EndOffset - 1
146- $parameter.Parent.Extent.ToString ().Substring($relativeOffset , $distance ) -replace ' ^[\r\n]+'
146+ $parameter.Parent.Extent.ToString ().Substring($relativeOffset , $distance ) -replace ' ^[\,\s\ r\n]+'
147147 } else {
148148 $parentExtent = $parameter.Parent.Extent.ToString ()
149149 $afterFirstParens = $parentExtent.IndexOf (' (' ) + 1
150150 $parentExtent.Substring ($afterFirstParens ,
151- $parameter.Extent.StartOffset - $parameter.Parent.Extent.StartOffset - $afterFirstParens ) -replace ' ^[\r\n]+'
151+ $parameter.Extent.StartOffset - $parameter.Parent.Extent.StartOffset - $afterFirstParens ) -replace ' ^[\s\ r\n]+'
152152 }
153153
154154
@@ -170,7 +170,7 @@ function Join-PipeScript
170170 $parameterIndex ++
171171 }
172172 })
173- $paramOut -join (' ,' + ([Environment ]::NewLine * 2 ))
173+ $paramOut -notmatch ' ^[\s\r\n]$ ' - join (' ,' + ([Environment ]::NewLine * 2 ))
174174 if (@ ($AllScriptBlocks.Ast.ParamBlock ) -ne $null ) {
175175 ' ' * (@ (@ ($AllScriptBlocks.Ast.ParamBlock ) -ne $null )[0 ] | MeasureIndent) + " )"
176176 }
You can’t perform that action at this time.
0 commit comments