使用Windows Azure PowerShell遠程管理Windows Azure虛擬機

對於Windows Azure,若是你還在使用windowsazure.com門戶來管理虛擬機,那就顯得不怎麼高上大了。Windows Azure PowerShell 是一個功能強大的腳本環境,可用於在 Windows Azure 中控制和自動執行工做負荷的部署和管理。windows

  安  裝   spa

經過Microsoft Web Platform Installer一鍵搞定安裝。orm

  登陸Azure帳戶   blog

啓動安裝好的Windows Azure PowerShell,使用「Add-AzureAccount」 命令來登陸你的Windows Azure帳戶,以下圖:ip

 若是你有多個訂閱,能夠經過「Select-AzureSubscription」命令進行設置,以下圖:ci

啓動、中止以及從新啓動Windows Azure虛擬機部署

Windows Azure PowerShell Cmdlet 支持使用 Restart-AzureVM、Stop-AzureVM 和 Start-AzureVM 命令執行從新啓動、中止和啓動虛擬機操做,其格式以下:get

Restart-AzureVM -ServiceName $cloudSvcName -Name $vmname  虛擬機

Stop-AzureVM -ServiceName $cloudSvcName -Name $vmname  io

Start-AzureVM -ServiceName $cloudSvcName -Name $vmname

其中,「-ServiceName $cloudSvcName」表示雲服務的名稱,「-Name $vmname」 虛擬機的名稱。例如,使用「Stop-AzureVM 」命令來關閉一臺虛擬機,以下圖:

使用「Start-AzureVM」 命令來啓動一臺虛擬機,以下圖:

其餘命令,請查看相關幫助。

相關文章
相關標籤/搜索