Pattern: Missing PSCredential
type for Credential parameter
Issue: -
If the cmdlet or function has a Credential
parameter, the parameter must accept the PSCredential
type.
Change the Credential
parameter's type to be PSCredential
.
Example of incorrect code:
function Credential([String]$Credential)
{
...
}
Example of correct code:
function Credential([PSCredential]$Credential)
{
...
}