diff --git a/src/functions/public/API/Invoke-GitHubAPI.ps1 b/src/functions/public/API/Invoke-GitHubAPI.ps1 index 462390d6..09321916 100644 --- a/src/functions/public/API/Invoke-GitHubAPI.ps1 +++ b/src/functions/public/API/Invoke-GitHubAPI.ps1 @@ -150,6 +150,10 @@ if ($Body) { # Use body to create the query string for certain situations if ($Method -eq 'GET') { + # If body conatins 'per_page' and its is null, set it to $context.PerPage + if ($Body.ContainsKey('per_page') -and $null -eq $Body['per_page']) { + $Body['per_page'] = $Context.PerPage + } $queryString = $Body | ConvertTo-QueryString $APICall.Uri = $APICall.Uri + $queryString } elseif ($Body -is [string]) {