# Get-Credential

*noun*

say it: **“GET kruh-DEN-shul”** **/ˈɡɛt krəˈdɛnʃəl/**

A PowerShell command that asks for a user name and password and hands them back together, with the password kept hidden.

## What does **Get-Credential** do?

`Get-Credential` asks the person running the script for a user name and a password, and hands them back together as one object, a PSCredential. PowerShell 7 asks in the terminal and shows a star for each character; Windows PowerShell 5.1 opens a small sign-in window. Commands with a `-Credential` parameter take the object as it is.

```powershell
$login = Get-Credential -UserName 'maple-street' -Message 'Sign in to the web host'
$login.UserName   # maple-street
```

## In a sentence

- “**Get-Credential** asked for the web host's password and showed only stars.”
- “Sam stored what **Get-Credential** returned in $login.”

Level: Journeyman · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=3)

Updated: November 10, 2026

Source: https://www.ask-codey.com/glossary/get-credential
