Add-AzureRmVmssDiagnosticsExtension

Adds a diagnostics extension to the VMSS.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Add-AzureRmVmssDiagnosticsExtension
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [-SettingFilePath] <String>
   [[-ProtectedSettingFilePath] <String>]
   [[-Name] <String>]
   [[-TypeHandlerVersion] <String>]
   [[-AutoUpgradeMinorVersion] <Boolean>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Add-AzureRmVmssDiagnosticsExtension cmdlet adds a diagnostics extension to the Virtual Machine Scale Set (VMSS) instance.

Examples

Example 1: Add a diagnostics extension to the VMSS

PS C:\> Add-AzureRmVmssDiagnosticsExtension -VirtualMachineScaleSet $VMSS -SettingFilePath $publicConfigPath -ProtectedSettingFilePath $privateConfigPath -Name $extName -TypeHandlerVersion $typeVersion -AutoUpgradeMinorVersion $True -Force

This command adds a diagnostics extension to the VMSS.

Parameters

-AutoUpgradeMinorVersion

Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version.

Type:Boolean
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of an extension.

Type:String
Aliases:ExtensionName
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ProtectedSettingFilePath

Specifies the path of the private configuration file.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SettingFilePath

Specifies the path of the public configuration file.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TypeHandlerVersion

Specifies the version of the extension to use for this VMSS. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Azure.Diagnostics for the PublisherName parameter and IaaSDiagnostics for the Type parameter.

Type:String
Aliases:HandlerVersion, Version
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VirtualMachineScaleSet

Specify the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.

Type:PSVirtualMachineScaleSet
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

VirtualMachineScaleSet

String

Boolean

Outputs

VirtualMachineScaleSet