> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# powershell/PSUsePSCredentialType

> Use PSCredential type.

`powershell/PSUsePSCredentialType` is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

| Property | Value            |
| -------- | ---------------- |
| Severity | Warning          |
| Category | PSScriptAnalyzer |
| Auto-fix | No               |

## 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

```powershell theme={null}
function Credential([String]$Credential)
{
    ...
}
```

### Correct code

```powershell theme={null}
function Credential([PSCredential]$Credential)
{
    ...
}
```

## Source

This rule documentation is adapted from Microsoft's PSScriptAnalyzer documentation for
[UsePSCredentialType](https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/blob/main/reference/docs-conceptual/PSScriptAnalyzer/Rules/UsePSCredentialType.md),
licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
