PSCredential
noun
say it: “PEE-ES kruh-DEN-shul” /ˌpiˈɛs krəˈdɛnʃəl/
A PowerShell object that holds a user name and its password together, with the password kept scrambled so it never prints.
What is a PSCredential?
A PSCredential keeps a user name and its password together in one object, so a script can hand both to a command in one go. The UserName is ordinary text; the Password is a SecureString, kept scrambled, so printing the object never shows it.
$login = Get-Credential -UserName 'maple-street'
$login
# UserName Password
# maple-street System.Security.SecureString
In a sentence
- “Any -Credential parameter takes a PSCredential as it is.”
- “The PSCredential printed the user name maple-street and only a type name for the password.”
Level: Journeyman · More PowerShell terms at this level
Updated