Skip to content

Commit

Permalink
Handle nextLink for Playbooks
Browse files Browse the repository at this point in the history
When retrieving playbooks not all are being returned. Code copied from Issue wortell#35 Retrieving all incidents.
  • Loading branch information
stehod authored Jun 11, 2020
1 parent 19a63bd commit efd88bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions AzSentinel/Private/Get-AzSentinelPlayBook.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ function Get-AzSentinelPlayBook {
}

try {
$playBook = (Invoke-RestMethod -Uri $uri -Method get -Headers $script:authHeader).value | Where-Object { $_.name -eq $Name }

$logicappRaw = (Invoke-RestMethod -Uri $uri -Method Get -Headers $script:authHeader)
$logicapp = $logicappRaw.value
while ($logicappRaw.nextLink) {
$logicappRaw = (Invoke-RestMethod -Uri $($logicappRaw.nextLink) -Headers $script:authHeader -Method Get)
$logicapp += $logicappRaw.value
}
$playBook = $logicapp | Where-Object { $_.name -eq $Name }
if ($playBook){
$uri1 = "https://management.azure.com$($playBook.id)/triggers/$($triggerName)/listCallbackUrl?api-version=2016-06-01"
try {
Expand Down

0 comments on commit efd88bb

Please sign in to comment.