Created
September 26, 2024 09:13
-
-
Save Kaloszer/509c9d1c76fed599bbf625251f590b1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $uri = "https://management.azure.com/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroupName)/providers/Microsoft.OperationalInsights/workspaces/$($WorkspaceName)/providers/Microsoft.SecurityInsights/automationRules?api-version=$($apiVersion)" | |
| Write-Verbose -Verbose $uri | |
| $automationRules = Invoke-RestMethod $uri -Method 'GET' -Headers $headers | |
| while ($null -ne $automationRules.nextLink) | |
| { | |
| $nextLink = $automationRules.nextLink | |
| Write-Verbose -Verbose "Next link found, getting next page" | |
| $nextPageAutomationRules = Invoke-RestMethod $nextLink -Method 'GET' -Headers $headers | |
| $automationRules.value += $nextPageAutomationRules.value | |
| $automationRules.nextLink = $nextPageAutomationRules.nextLink | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment