Edit

Share via


Credential Attribute Declaration

The Credential attribute is an optional attribute that can be used with credential parameters of type System.Management.Automation.PSCredential so that a string can also be passed as an argument to the parameter. When this attribute is added to a parameter declaration, Windows PowerShell converts the string input into a System.Management.Automation.PSCredential object. For example, the Get-Credential cmdlet uses this attribute to have Windows PowerShell generate the System.Management.Automation.PSCredential object that is returned by the cmdlet.

Syntax

[Credential]

Remarks

See Also

Parameter Aliases

Parameter Attribute Declaration

Writing a Windows PowerShell Cmdlet