Azure / Azure/azure-functions-powershell-worker
Consider avoiding the use of powershell anti-pattern "return $foo"
- Dominant language
- C#
- Stars
- 215
- Forks
- 61
- Avg merge
- 21h 4m
- Merged PRs (30d)
- 6
Description
As per:
https://github.com/Azure/azure-functions-powershell-worker/blob/v1.0.197/examples/durable/FunctionChainingApp/SayHello/run.ps1
While `return` accepts explicit retvals, it should only ever be used in naked form for exiting a function early. Returning a value is considered an anti-pattern in powershell because it gives the impression to people unfamiliar with the language that `return` is the only way to return values, when the reality is that any non-captured output is returned.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with examples/durable/FunctionChainingApp/SayHello/run.ps1, linked in the issue, and review how its output is produced in PowerShell. Done means the example no longer uses the cited return-value anti-pattern while preserving the function's output behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- documentation
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100