Skip to content

Consider avoiding the use of powershell anti-pattern "return $foo"  #398

Open
@oising

Description

@oising

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions