The previous post describes how to use PowerShell to control the startup and shutdown of azure virtual machines, and today we describe how to create a virtual machine using PowerShell
First, sign in to Azure with PowerShelland view the list of virtual machines
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7F/4B/wKioL1cZgB_xJMuLAAAm4TP-Vdg833.png "title=" 1.png " alt= "Wkiol1czgb_xjmulaaam4tp-vdg833.png"/>
First, we need to set the environment under which the virtual machine is created
Get subscription name information using the get-azuresubscription command
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/4D/wKiom1cZf2awT9sqAAAfklFhHPE615.png "title=" 2.png " alt= "Wkiom1czf2awt9sqaaafklfhhpe615.png"/>
use get-azurestorageaccount to get the name of the storage account
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/4D/wKiom1cZf27ix0LIAABV89xLZ7w296.png "title=" 3.png " alt= "Wkiom1czf27ix0liaabv89xlz7w296.png"/>
we use the command set-azuresubscription-subscriptionname "Windows Azureenterprise"-currentstorageaccount fnportalvhds7bxzhqhgw58k Set the virtual machine to be created under Windowsazure Enterprise subscription and use the China East fnportalvhds7bxzhqhgw58k 's Storage account
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/4D/wKiom1cZf3ejuYfJAAAUR34LzLo321.png "title=" 4.png " alt= "Wkiom1czf3ejuyfjaaaur34lzlo321.png"/>
Next, we start creating the virtual machine
Get image information Get-azurevmimage, here we create a Windows Server R2 Datacenter version of the virtual server, record the name of the image 55bc2b193643443bb879a78bda516fc8__windows-server-2012-r2-20160229-zh.cn-127gb.vhd
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7F/4D/wKiom1cZf4Djc6E8AAAxv3eHc2s220.png "title=" 5.png " alt= "Wkiom1czf4djc6e8aaaxv3ehc2s220.png"/>
Use the Help command to view specific parameter information for creating a virtual machine
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7F/4B/wKioL1cZgE3CSztxAABbOhhzhQQ958.png "title=" 6.png " alt= "Wkiol1czge3csztxaabbohhzhqq958.png"/>
Create a virtual machine
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/4D/wKiom1cZf5KCIaXUAAAp_br81Lk199.png "title=" 7.png " alt= "Wkiom1czf5kciaxuaaap_br81lk199.png"/>
In portal management, you can see that virtual machines and cloud services are being created
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/4D/wKiom1cZf5qyWVvoAACZgCnnAJQ878.png "title=" 8.png " alt= "Wkiom1czf5qywvvoaaczgcnnajq878.png"/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/4D/wKiom1cZf6PDwKU0AAE4X_kHECY326.png "title=" 9.png " alt= "Wkiom1czf6pdwku0aae4x_khecy326.png"/>
Connect the virtual machine you just created
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7F/4D/wKiom1cZf63jxeMgAADespSW3Ck371.png "title=" 10.png "alt=" Wkiom1czf63jxemgaadespsw3ck371.png "/>
This article is from the "Stit" blog, make sure to keep this source http://yourcloud.blog.51cto.com/1382814/1766549
Windows Azure uses PowerShell to create virtual machines