Created
January 3, 2017 05:12
-
-
Save goyalmohit/10a9691d3e68f341ec1e914918b26c20 to your computer and use it in GitHub Desktop.
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
#Login into Microsoft Azure | |
add-azureaccount | |
#Create a new storage account, if not already having one | |
$storageAccountName = "qastoragenortheurope" | |
$storageAccountLocation = "north europe" | |
$storageAccountType = "Standard_LRS" | |
New-AzureStorageAccount -StorageAccountName $storageAccountName ` | |
-Location $storageAccountLocation ` | |
-Type $storageAccountType | |
#Set default storage account for current azure subscription | |
Set-AzureSubscription -SubscriptionId <your subscription id> ` | |
-CurrentStorageAccountName "qastoragenortheurope" | |
#create quick azure vm | |
$adminUser = "itadmin" | |
$password = "itadmin@123" | |
$serviceName = "metavrsewebqa" | |
$location = "north europe" | |
$size = "Small" | |
$vmName = "metavrse-web-01" | |
$imageFamily = "Windows Server 2012 R2 Datacenter" | |
$imageName = Get-AzureVMImage | | |
where { $_.ImageFamily -eq $imageFamily } | | |
sort PublishedDate -Descending | | |
select -ExpandProperty ImageName -First 1 | |
New-AzureQuickVM -Windows ` | |
-ServiceName $serviceName ` | |
-Name $vmName ` | |
-ImageName $imageName ` | |
-AdminUsername $adminUser ` | |
-Password $password ` | |
-InstanceSize $size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment