-
Notifications
You must be signed in to change notification settings - Fork 294
Write-Output vs. Return vs. $Output #46
Copy link
Copy link
Open
Description
There is currently a recommendation in Function and Structure to not use "return" but it says to "just put the variable on a line by itself" ...
I wonder if that's the majority opinion?
Assuming this is the last line of my function, what's better:
$output = $temp + (Get-Thing $temp)
return $output$output = $temp + (Get-Thing $temp)
$output$output = $temp + (Get-Thing $temp)
Write-Output $outputI won't go into piping output to Write-Output ;-)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels