Creates a new credential.
You will be prompted to securely enter your password, then a credential will be created in the master database on server1 if it does not exist.
New-DbaCredential -SqlInstance Server1
Suppresses all prompts to install but prompts to securely enter your password and creates a credential in the ‘db1’ database
New-DbaCredential -SqlInstance Server1 -Database db1 -Confirm:$false
This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.