Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 576 Bytes

File metadata and controls

39 lines (29 loc) · 576 Bytes
description Use PSCredential type.
ms.custom PSSA v1.21.0
ms.date 06/28/2023
ms.topic reference
title 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)
{
    ...
}