Skip to content

Commit cd8eeb5

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5a98df6 commit cd8eeb5

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/powershell/tests/Test-Assessment.41201.ps1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,23 @@ function Test-Assessment-41201 {
112112
$dataConnectorsPath = "$($workspace.WorkspaceId)/providers/Microsoft.SecurityInsights/dataConnectors?api-version=$dataConnectorsApiVersion"
113113

114114
try {
115-
$connectorsByWorkspace[$workspace.WorkspaceId] = @(Invoke-ZtAzureRequest -Path $dataConnectorsPath -ErrorAction Stop)
115+
$workspaceConnectors = @()
116+
$nextPath = $dataConnectorsPath
117+
118+
do {
119+
$response = Invoke-ZtAzureRequest -Path $nextPath -ErrorAction Stop
120+
121+
if ($null -ne $response -and $response.PSObject.Properties['value']) {
122+
$workspaceConnectors += @($response.value)
123+
$nextPath = $response.nextLink
124+
}
125+
else {
126+
$workspaceConnectors += @($response)
127+
$nextPath = $null
128+
}
129+
} while ($nextPath)
130+
131+
$connectorsByWorkspace[$workspace.WorkspaceId] = @($workspaceConnectors)
116132
}
117133
catch {
118134
$connectorsByWorkspace[$workspace.WorkspaceId] = $null

0 commit comments

Comments
 (0)