Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 552 Bytes

UsePSCredentialType.md

File metadata and controls

38 lines (28 loc) · 552 Bytes
description ms.date ms.topic title
Use PSCredential type.
06/28/2023
reference
UsePSCredentialType

UsePSCredentialType

Severity Level: Warning

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

Wrong

function Credential([String]$Credential)
{
    ...
}

Correct

function Credential([PSCredential]$Credential)
{
    ...
}