When creating a VM, several options are available to you—including OS image, network configuration, and administrative credentials. However, a VM can also be created with default settings, using a minimal configuration.
The process of provisioning a VM consists of two different PowerShell commands. The first command, called Get-Credential, allows you to specify local administrator credentials for the VM. Once those credentials have been established, you can run the New-AzureRmVm command to configure and deploy a VM.
To create a local admin account and password for the VM being deployed, run the following command:
$cred = Get-Credential
This command results in a prompt, to which you can respond, by supplying ...