The first command assigns a user name to the $User variable.
The second command converts a plain text password into a secure string by using the ConvertTo-SecureString cmdlet.
The command stores that object in the $Password variable.
The third command creates a credential based on $User and $Password, and then stores it in the $Credential variable.
The final command creates an Automation credential named ContosoCredential that uses $Credential.
Parameters
-AutomationAccountName
Specifies the name of the Automation account in which this cmdlet stores the credential.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.