A special type of variable is the credential. Credentials contain not one but two values: a username and a password. Credentials are treated as secrets everywhere they are used. This means that they will not appear in logs and that they have to be retrieved using a specific PowerShell syntax:
$myCredential = Get-AutomationPSCredential -Name 'MyCredential'
After executing this command, the myCredential object can be used to retrieve both the username and password.