Modifier

Partager via


Add-AzVmssDiagnosticsExtension

Adds a diagnostics extension to the VMSS.

Syntax

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

Description

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

Examples

Example 1: Add a diagnostics extension to the VMSS

Add-AzVmssDiagnosticsExtension -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:AzContext, 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-AzVMExtensionImage 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-AzVmssConfig 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

PSVirtualMachineScaleSet

String

Boolean

Outputs

PSVirtualMachineScaleSet