Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions EntraReporter/functions/Get-EntraIdRoleAssignment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#>
function Get-EntraIdRoleAssignment {
[CmdletBinding()]
[OutputType([PSCustomObject[]])]
param(
[Parameter()]
[string[]]
Expand Down Expand Up @@ -82,6 +83,7 @@ function Get-EntraIdRoleAssignment {

# New-RoleAssignmentEntry: build and normalize a role assignment output record
function New-RoleAssignmentEntry {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Doesnt really change state, just normalizes output')]
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string]$RoleId, # Role definition ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#>
function Get-EntraIdGroupScheduleBatch {
[CmdletBinding()]
param(
# Array of Azure AD group IDs to fetch schedules for
[Parameter(Mandatory = $true)]
Expand All @@ -54,7 +55,7 @@ function Get-EntraIdGroupScheduleBatch {
}

# Split the GroupId array into chunks of 20 for batch processing (Graph API batch limit optimization)
$chunks = Split-ArrayIntoChunks -InputObject $GroupId -ChunkSize 20
$chunks = Split-ArrayIntoChunk -InputObject $GroupId -ChunkSize 20

# Process each chunk through the Graph batch API and collect all responses
$allResponses = foreach ($chunk in $chunks) {
Expand Down
5 changes: 4 additions & 1 deletion EntraReporter/internal/functions/Invoke-GraphPaged.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
Uses Invoke-MgGraphRequest to perform each request and expects standard Graph pagination (`@odata.nextLink`).
#>
function Invoke-GraphPaged {
[CmdletBinding()]
[OutputType([System.Object[]])]
param(
[Parameter(Mandatory)][string] $Uri
[Parameter(Mandatory)]
[string]$Uri
)
$items = @()
$next = $Uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
A list of object arrays, where each array is a chunk from the original input.

.EXAMPLE
Split-ArrayIntoChunks -InputObject @(1,2,3,4,5) -ChunkSize 2
Split-ArrayIntoChunk -InputObject @(1,2,3,4,5) -ChunkSize 2

Returns chunks: @(1,2), @(3,4), @(5)

.NOTES
Used by EntraReporter helpers for batching Graph requests.
#>
function Split-ArrayIntoChunks {
function Split-ArrayIntoChunk {
[CmdletBinding()]
[OutputType([System.Array])]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
Expand Down
1 change: 1 addition & 0 deletions EntraReporter/internal/functions/Test-GraphConnection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#>
function Test-GraphConnection {
[CmdletBinding()]
[OutputType([System.Boolean])]
param ()

# Check if Graph module is installed
Expand Down