Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureVM

Get-AzureVM

microsoft.azure.commands.compute.dll, microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Get the properties of a VM or Get all VMs in a subscription

Syntax

Get-AzureVM [-All] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Get-AzureVM [-ResourceGroupName] [-Name] [-Status] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Get-AzureVM [-ResourceGroupName] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Get-AzureVM [-NextLink] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Detailed Description

This cmdlet allows you to get the model or instance view of the VM. By default the returned VM object contains the model view. If you'd like to see the instance view of a VM use the -Status switch.

This cmdlet also allows you to get information about all VMs in your subscription if no parameters are used.

Parameters

-All <SwitchParameter>

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Profile <AzureProfile>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationAction <ActionPreference>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationVariable <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ResourceGroupName <String>

Name of the Resource Group

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Name <String>

Name of the VM

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Status <SwitchParameter>

Allows you to only return the Instance View

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-NextLink <Uri>

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Get the properties of a VM --------------------------

# Get the VM
$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM"

-------------------------- Get only the status of VM --------------------------

Get the VM instance view
$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" -Status

-------------------------- Get all VMs in a Resource Group --------------------------

# Get all VMs in a Resource Group
$vm = Get-AzureVM -ResourceGroupName "myRG"

-------------------------- Get all VMs in your subscription --------------------------

# Get all VMs in your subscription
Get-AzureVM