Last active
October 25, 2020 05:33
-
-
Save acerzhou/cb3519db5eddbdbf488686ff6998c12d to your computer and use it in GitHub Desktop.
[Azure Powershell] Azure PowerShell #Azure #Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$myResourceGroup = Read-Host -prompt "Enter a resource group name: " | |
$myLocation = Read-Host -prompt "Enter a location (ie. WestUS): " | |
$myVM = Read-Host -prompt "Enter a VM name: " | |
$vmAdmin = Read-Host -prompt "Enter a VM admin user name: " | |
# The password must meet the length and complexity requirements. | |
$vmPassword = Read-Host -prompt "Enter the admin password: " | |
# create a resource group | |
New-AzResourceGroup -Name $myResourceGroup -Location $myLocation | |
# Create the virtual machine. When prompted, provide a username | |
# and password to be used as the logon credentials for the VM. | |
New-AzVm ` | |
-ResourceGroupName $myResourceGroup ` | |
-Name $myVM ` | |
-Location $myLocation ` | |
-adminUsername $vmAdmin ` | |
-adminPassword $vmPassword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-AzResourceGroupDeployment ` | |
-Mode Complete ` | |
-Name ExampleDeployment ` | |
-ResourceGroupName ExampleResourceGroup ` | |
-TemplateFile c:\MyTemplates\storage.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment