File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ function Test-Assessment-41210 {
144144 try {
145145 $rawMetrics = @ (Invoke-ZtAzureRequest - Path $tiMetricsPath - ErrorAction Stop)
146146 # A non-empty response must contain properties.sourceMetrics; absence is an unexpected shape.
147- $schemaOk = ($rawMetrics.Count -eq 0 ) -or ($null -ne $rawMetrics [0 ].properties -and $null -ne $rawMetrics [0 ].properties.sourceMetrics)
147+ # Reject the entire response if any item is missing the documented structure.
148+ $schemaOk = ($rawMetrics.Count -eq 0 ) -or (($rawMetrics | Where-Object { $null -eq $_.properties -or $null -eq $_.properties.sourceMetrics }).Count -eq 0 )
148149 if ($schemaOk ) {
149150 $metricsByWorkspace [$workspace.WorkspaceId ] = $rawMetrics
150151 $metricsOkByWorkspace [$workspace.WorkspaceId ] = $true
You can’t perform that action at this time.
0 commit comments