Skip to content

Post should get updated with additional information (Error handling in classes) #7

@Szeraax

Description

@Szeraax

https://vexx32.github.io/2019/01/31/PowerShell-Error-Handling/

This post is amazing, but it doesn't talk about error handling in classes (where you don't have $PSCmdlet).

Explain that since PSCmdlet doesn't exist, you should use throw, possibly with an example similar to this:

throw [ArgumentException]::new("Bad data: $argumentVariable")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions