Created
November 17, 2015 15:19
-
-
Save sqlchow/8c960912ca1c703c2b42 to your computer and use it in GitHub Desktop.
Quickly get Azure ARM VM PowerState
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To use with the newer Azure PowerShell use Get-AzureRmVM instead of Get-AzureVM | |
Get-AzureVM -Name 'AzureRmVM01' -ResourceGroupName 'arm-rg' -Status | ` | |
Select-Object -ExpandProperty Statuses | Where-Object {$_.Code -like '*PowerState*'} | ` | |
Select-Object @{l='PowerState';e={$_.Code.Split('/')[1]}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get-AzureRmVM, is what I think you mean. What are the valid PowerStates?