Get-AzVMExtension

SYNOPSIS

Gets information about a virtual machine extension.

SYNTAX

Get-AzVMExtension -ExtensionName [string] -VMName [string] [-ResourceGroupName [string]] [-Status] [-SubscriptionId [string]] [-DefaultProfile [IAzureContextContainer]] [-WhatIf] [-Confirm] [CommonParameters]
Get-AzVMExtension -VMName [string] -ExtensionName [string] -ResourceGroupName [string] [-SubscriptionId [string]] [-DefaultProfile [IAzureContextContainer]] [-WhatIf] [-Confirm] [CommonParameters]
Get-AzVMExtension -ResourceId [string] [-Status] [-SubscriptionId [string]] [-DefaultProfile [IAzureContextContainer]] [-WhatIf] [-Confirm] [CommonParameters]

DESCRIPTION

The -Get-AzVMExtension cmdlet gets information about a virtual machine extension. You can specify the virtual machine and extension to get information about a specific extension, or you can get information about all extensions for a virtual machine.

PARAMETERS

Name Type Description
-ExtensionName string Specifies the name of the virtual machine extension.
-VMName string Specifies the name of the virtual machine.
-ResourceGroupName string Specifies the name of the resource group to which the virtual machine belongs.
-Status switch Gets the status of the virtual machine extension.
-SubscriptionId string Specifies the ID of the subscription.
-DefaultProfile IAzureContextContainer The credentials, account, tenant, and subscription for the cloud service. Alternately, you can use Load-AzContext cmdlet to set the subscription and default resource group.
-WhatIf switch Performs the cmdlet in the form of a simulation. Only the cmdlets that would be run are displayed.
-Confirm switch Prompts you for confirmation before running the cmdlet.

INPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineExtension

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine

OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineExtension

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineExtensionInstanceView

EXAMPLES

Example 1: Get a specific VM extension

Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine12" -ExtensionName "Microsoft.Compute.CustomScriptExtension1"

Example 2: Get all extensions for a VM

Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine12"

Example 3: Get the status of a specific VM extension

Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine12" -ExtensionName "Microsoft.Compute.CustomScriptExtension1" -Status