Here are the steps:
- Download Microsoft Azure PowerShell
- Open console
- Enter the Add-AzureAccount command
- Login with Microsoft account and password
To get a list of cmdlets, enter the command “get-help azure”.
I was curious if I could create a command to stop and start a virtual machine. I did some research and found the commands. The one question I had was what was the service name. The service name is the DNS name.
To start a VM, the command is:
- Start-AzureVM -ServiceName “mgw-vm-test1” -Name “mgw-vm-test1”
To stop a VM, the command is:
- Stop-AzureVM -ServiceName “mgw-vm-test1” -Name “mgw-vm-test1” -Force
To check status on a VM, the command is:
Get-AzureVM -ServiceName “mgw-vm-test1” -Name “mgw-vm-test1”