Skip to content

Capitalization of function parameter type #154

Open
@OCram85

Description

@OCram85

I'm currently working on a internal style guide for new colleagues and got stuck while comparing the capitalization content.
So I read the article and discussions here. And there is one aspect I couldn't find or just have missed.

Whats about the function parameter types like:

  • String/string
  • Integer/integer
  • Switch/switch
  • PSCustomObject/pscustomobject?

Should these be written in PascalCase oder is there difference between basic types and objects/classes? - In the code snippets of the Code-Layout-and-Formatting article they are in lowercase. So If i get this right, they should be in PascalCase because they match to the rule for .Net Class types, since pwsh types are basically .net Objects?

💡 Example:

function Invoke-FooBar {
    [CmdletBinding()]
    #[OutputType([String])]

    param (
        [Parameter(Mandatory = $true)]
        [String]$MyParam
    )

    begin {
    }

    process {
    }

    end {
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions