Skip to content

Naming Convention

John Klann edited this page May 28, 2016 · 5 revisions

Cmdlets and Functions:

CLI Cmdlets

Cmdlets with the intention of being used directly on the Command Line (in PowerShell console) must be named with KeePass as the noun's prefix. This prevents ambiguity, and promotes discover-ability.

Example:

Get-KeePassEntry

Scripting Cmdlets

Cmdlets with the intention of being used to script with must be named with KP as the noun's prefix. This will help prevent discovering these cmdlets from the CLI, and any confusion of the intention of the cmdlet.

Example:

Get-KPEntry

Parameters and Variables:

If the parameter or variable is of a type that comes from the KeePass SDK or is a custom PSObject generated by one of the cmdlets in the PSKeePass module it should be spelled with the prefix of KeePass. It should also be clearly named and not ambiguous with no unnecessary abbreviations:

  • Good:

    [KeePassLib.PwDatabase] $KeePassConnection

  • Bad:

    [KeePassLib.PwDatabase] $KpConnection

    [KeePassLib.PwDatabase] $Connection

    [KeePassLib.PwDatabase] $KeePassConn

If the parameter or variable is not of one of the aforementioned types then is should be clearly named and not ambiguous with no unnecessary abbreviations.

  • Good:

    [String] $SecureTitle

    [String] $SecureURL

  • Bad:

    [String] $SecTitle

    [String] $SecURL