Skip to main content
powershell/PSUsePSCredentialType is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

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.

Examples

Problematic code

Correct code

Source

This rule documentation is adapted from Microsoft’s PSScriptAnalyzer documentation for UsePSCredentialType, licensed under CC BY 4.0.