Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Get-AzVMExtension
- Module:
- Az.Compute Module
Gets properties of Virtual Machine Extensions installed on a virtual machine.
Syntax
GetExtensionParameterSet (Default)
Get-AzVMExtension
[-ResourceGroupName] <String>
[-VMName] <String>
[[-Name] <String>]
[-Status]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
VMParameterSet
Get-AzVMExtension
[-Status]
[-VMObject <PSVirtualMachine>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ResourceIdParameterSet
Get-AzVMExtension
[-Status]
[-ResourceId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzVMExtension cmdlet gets properties of Virtual Machine Extensions installed on a virtual machine. Specify the name of an extension for which to get properties. To get only the instance view of an extension, specify the Status parameter.
Examples
Example 1: Get properties of an extension
Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension"
ResourceGroupName : ResourceGroup11
VMName : VirtualMachine22
Name : CustomScriptExtension
Location : eastus
Etag : null
Publisher : Microsoft.Azure.Extensions
ExtensionType : CustomScript
TypeHandlerVersion : 2.0
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup11
/providers/Microsoft.Compute/virtualMachines/VirtualMachine22/extensions/CustomScriptExtension
PublicSettings : {}
ProtectedSettings :
ProvisioningState : Succeeded
Statuses :
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
This command gets properties for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11.
Example 2: Get instance view of an extension
Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Status
ResourceGroupName : ResourceGroup11
VMName : VirtualMachine22
Name : CustomScriptExtension
Location : eastus
Etag : null
Publisher : Microsoft.Azure.Extensions
ExtensionType : CustomScript
TypeHandlerVersion : 2.0
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup11
/providers/Microsoft.Compute/virtualMachines/VirtualMachine22/extensions/CustomScriptExtension
PublicSettings : {}
ProtectedSettings :
ProvisioningState : Succeeded
Statuses : {Microsoft.Azure.Management.Compute.Models.InstanceViewStatus}
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
This command gets the instance view for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11.
Example 3: Get all extensions installed on a VM
Get-AzVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22"
ResourceGroupName : ResourceGroup11
VMName : VirtualMachine22
Name : CustomScriptExtension
Location : eastus
Etag : null
Publisher : Microsoft.Azure.Extensions
ExtensionType : CustomScript
TypeHandlerVersion : 2.0
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup11
/providers/Microsoft.Compute/virtualMachines/VirtualMachine22/extensions/CustomScriptExtension
PublicSettings : {}
ProtectedSettings :
ProvisioningState : Succeeded
Statuses :
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
Example 4: Get properties of an extension using the VMObject parameter
$vm = Get-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine22"
Get-AzVMExtension -VMObject $vm
ResourceGroupName : ResourceGroup11
VMName : VirtualMachine22
Name : CustomScriptExtension
Location : eastus
Etag : null
Publisher : Microsoft.Azure.Extensions
ExtensionType : CustomScript
TypeHandlerVersion : 2.0
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup11
/providers/Microsoft.Compute/virtualMachines/VirtualMachine22/extensions/CustomScriptExtension
PublicSettings : {}
ProtectedSettings :
ProvisioningState : Succeeded
Statuses :
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
This command gets the list of extensions installed on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-Name
Specifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ExtensionName |
Parameter sets
-ResourceGroupName
Specifies the name of a resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceId
Resource Id specifying the virtual machine object the extension is on.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Status
Indicates that this cmdlet gets only the instance view of an extension.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VMName
Specifies the name of a virtual machine. This cmdlet gets properties of an extension from the virtual machine that this parameter specifies.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ResourceName |
Parameter sets
-VMObject
Specifies the virtual machine object the extension is on.
Parameter properties
| Type: | PSVirtualMachine |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
SwitchParameter
Outputs
PSVirtualMachineExtension
Related Links
Azure PowerShell
Feedback
Was this page helpful?
