Skip to content

Alter script parameters to be more PowerShell-y. #3

@pfaffle

Description

@pfaffle

Rather than have a general "option" parameter which can be parsed in different ways, the script should define two different sets of parameters which are mutually exclusive, and alter the behavior of the script depending on which set is used.
http://blogs.msdn.com/b/powershell/archive/2008/12/23/powershell-v2-parametersets.aspx

Also, for required parameters, use the [CmdletBinding()] directive and specifically mark those parameters as required, rather than writing logic to check if they have a value.
http://technet.microsoft.com/en-us/magazine/jj554301.aspx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions