Skip to content

Files

Latest commit

 

History

History
33 lines (22 loc) · 665 Bytes

UsePSCredentialType.md

File metadata and controls

33 lines (22 loc) · 665 Bytes

Pattern: Missing PSCredential type for Credential parameter

Issue: -

Description

If the cmdlet or function has a Credential parameter, the parameter must accept the PSCredential type.

How

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)
{
	...
}

Further Reading