【发布时间】:2021-09-11 03:37:50
【问题描述】:
Set-AzureRmDiagnosticSetting : 找不到与参数名称“名称”匹配的参数。
在 Azure powershell 任务中执行以下命令后
Set-AzureRmDiagnosticSetting -ResourceId $resourceId -Name $diagnosticsettingname -Enabled $true -Categories $logarray -MetricCategory $metricsarray -WorkspaceId $work
我遇到了异常
“Set-AzureRmDiagnosticSetting : 找不到与参数名称“名称”匹配的参数。”
根据规范,其中有 -Name 参数。那么为什么我会收到这个错误
【问题讨论】:
-
这取决于您的 Azure RM Powershell 版本。
Name参数针对版本 6.13.0 列出,但不针对 5.7.0 和 4.4.1。见Set-AzureRmDiagnosticSetting -
如果您正在构建 CICD 管道并使用 Azure Powershell 任务,请保留注释,请尝试使用旧版本,即 3。使用 Azure powershell 最新版本时会出现异常
标签: azure powershell devops