File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments