使用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” 命令来启动一台虚拟机,以下图:

其余命令,请查看相关帮助。

相关文章
相关标签/搜索