< Back
Get-AzureRmVM
Post
NAME Get-AzureRmVM
SYNOPSIS
Gets the properties of a virtual machine.
SYNTAX
Get-AzureRmVM [-ResourceGroupName] <String> [-Name] <String> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [-DisplayHint {Compact |
Expand}] [<CommonParameters>]
Get-AzureRmVM [-NextLink] <Uri> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Get-AzureRmVM [-ResourceGroupName] <String> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Get-AzureRmVM cmdlet gets the model view and instance view of an Azure virtual machine. The model view is the user specified properties of the
virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view
of a virtual machine.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DisplayHint <DisplayHintType>
Determines how the virtual machine object is displayed.
Valid values are:
-- Compact: displays only top level properties
-- Expand: displays all properties in all levels
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the virtual machine to get.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NextLink <Uri>
Specifies the next link.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of a resource group.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Status [<SwitchParameter>]
Indicates that this cmdlet gets only the instance view of the virtual machine.
Required? false
Position? 2
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine
Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineInstanceView
NOTES
Example 1: Get model and instance view properties
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07"
This command gets the model view and instance view properties of the virtual machine named VirtualMachine07.
Example 2: Get instance view properties
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Status
This command gets properties of the virtual machine named VirtualMachine07. This command specifies the Status parameter. Therefore, the command
gets only the instance view properties.
Example 3: Get properties for all virtual machines in a resource group
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11"
This command gets properties for all the virtual machines in the resource group named ResourceGroup11.
Example 4: Get all virtual machines in your subscription
PS C:\\> Get-AzureRmVM
This command gets all the virtual machines in your subscription.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... -azurermvm
New-AzureRmVMConfig
Remove-AzureRmVM
Restart-AzureRmVM
Restart-AzureRmVM
Stop-AzureRmVM
Update-AzureRmVmss
SYNOPSIS
Gets the properties of a virtual machine.
SYNTAX
Get-AzureRmVM [-ResourceGroupName] <String> [-Name] <String> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [-DisplayHint {Compact |
Expand}] [<CommonParameters>]
Get-AzureRmVM [-NextLink] <Uri> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Get-AzureRmVM [-ResourceGroupName] <String> [[-Status]] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Get-AzureRmVM cmdlet gets the model view and instance view of an Azure virtual machine. The model view is the user specified properties of the
virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view
of a virtual machine.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DisplayHint <DisplayHintType>
Determines how the virtual machine object is displayed.
Valid values are:
-- Compact: displays only top level properties
-- Expand: displays all properties in all levels
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the virtual machine to get.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NextLink <Uri>
Specifies the next link.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of a resource group.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Status [<SwitchParameter>]
Indicates that this cmdlet gets only the instance view of the virtual machine.
Required? false
Position? 2
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine
Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineInstanceView
NOTES
Example 1: Get model and instance view properties
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07"
This command gets the model view and instance view properties of the virtual machine named VirtualMachine07.
Example 2: Get instance view properties
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Status
This command gets properties of the virtual machine named VirtualMachine07. This command specifies the Status parameter. Therefore, the command
gets only the instance view properties.
Example 3: Get properties for all virtual machines in a resource group
PS C:\\> Get-AzureRmVM -ResourceGroupName "ResourceGroup11"
This command gets properties for all the virtual machines in the resource group named ResourceGroup11.
Example 4: Get all virtual machines in your subscription
PS C:\\> Get-AzureRmVM
This command gets all the virtual machines in your subscription.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... -azurermvm
New-AzureRmVMConfig
Remove-AzureRmVM
Restart-AzureRmVM
Restart-AzureRmVM
Stop-AzureRmVM
Update-AzureRmVmss