Functions/Authentication/PSCredential/New-CredentialMetaObj.ps1

Function New-CredentialMetaObj
{
    [CmdletBinding()]
    Param
    (
        # Accessible Name/Alias of Credential Object
        [Parameter(Mandatory=$true)]
        [String]
        $name,
        
        # Credential Type
        [Parameter(Mandatory=$true)]
        [ValidateSet("Identity","Service","Local","All")]
        [string]
        $type,
        
        # Username for this Credential
        [Parameter(Mandatory=$true)]
        [String]
        $userName,

        # AD Domain for this credential
        [Parameter(Mandatory=$false)]
        [String]
        $domain,

        # Hint to use in the creation prompt for this credential
        [Parameter(Mandatory=$true)]
        [String]
        $hint,
        
        # Credential Expiry
        [Parameter(Mandatory=$true)]
        [Boolean]
        $expires
    )
    Process
    {
        # Create new PSObject based on Parameter Input
        [pscustomobject]([ordered]@{
            name = $name
            type = $type
            userName = $userName
            domain  = $domain
            hint = $hint
            expires = $expires
        })
    }
}