I am trying to write a simple powershell script to shutdown/start all VMs in my Azure account.
The Get-AzureVM cmdlet shows me all the information I want: cloud service name, VM name and VM status for every VM.
When I use the same cmdlet in the following script ...
$listVM = Get-AzureVM
foreach ($vm in $listVM) write-host $vm }
the output is (once for each VM): Microsoft.WindowsAzure.Commands.SerivceManagement.Model.PersistentVMRoleListContext
How do I iterate a list of VMs (by name ) and start/stop them?
Thanks, Chris
ChrisB