你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Add-AzureRmVmssDiagnosticsExtension
将诊断扩展添加到 VMSS。
警告
截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。
尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源。
语法
Add-AzureRmVmssDiagnosticsExtension
[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
[-SettingFilePath] <String>
[[-ProtectedSettingFilePath] <String>]
[[-Name] <String>]
[[-TypeHandlerVersion] <String>]
[[-AutoUpgradeMinorVersion] <Boolean>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Add-AzureRmVmssDiagnosticsExtension cmdlet 将诊断扩展添加到虚拟机规模集(VMSS)实例。
示例
示例 1:向 VMSS 添加诊断扩展
PS C:\> Add-AzureRmVmssDiagnosticsExtension -VirtualMachineScaleSet $VMSS -SettingFilePath $publicConfigPath -ProtectedSettingFilePath $privateConfigPath -Name $extName -TypeHandlerVersion $typeVersion -AutoUpgradeMinorVersion $True -Force
此命令将诊断扩展添加到 VMSS。
参数
-AutoUpgradeMinorVersion
指示此 cmdlet 是否允许 Azure 来宾代理将扩展自动更新为较新的次要版本。
类型: | Boolean |
Position: | 5 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
强制运行命令而不要求用户确认。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
指定扩展的名称。
类型: | String |
别名: | ExtensionName |
Position: | 3 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ProtectedSettingFilePath
指定专用配置文件的路径。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-SettingFilePath
指定公共配置文件的路径。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-TypeHandlerVersion
指定要用于此 VMSS 的扩展的版本。 若要获取版本,请使用 PublisherName 参数的值和 Type 参数的 IaaSDiagnostics 的值运行 Get-AzureRmVMExtensionImage cmdlet。
类型: | String |
别名: | HandlerVersion, Version |
Position: | 4 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-VirtualMachineScaleSet
指定 VMSS 对象。 可以使用 New-AzureRmVmssConfig cmdlet 创建对象。
类型: | PSVirtualMachineScaleSet |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |