diff --git a/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 b/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 index c5b21d8..264ccdb 100644 --- a/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 +++ b/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 @@ -27,6 +27,7 @@ #> function Get-EntraIdRoleAssignment { [CmdletBinding()] + [OutputType([PSCustomObject[]])] param( [Parameter()] [string[]] @@ -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 diff --git a/EntraReporter/internal/functions/Get-EntraIdGroupScheduleBatch.ps1 b/EntraReporter/internal/functions/Get-EntraIdGroupScheduleBatch.ps1 index 5293eac..93bff02 100644 --- a/EntraReporter/internal/functions/Get-EntraIdGroupScheduleBatch.ps1 +++ b/EntraReporter/internal/functions/Get-EntraIdGroupScheduleBatch.ps1 @@ -28,6 +28,7 @@ #> function Get-EntraIdGroupScheduleBatch { + [CmdletBinding()] param( # Array of Azure AD group IDs to fetch schedules for [Parameter(Mandatory = $true)] @@ -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) { diff --git a/EntraReporter/internal/functions/Invoke-GraphPaged.ps1 b/EntraReporter/internal/functions/Invoke-GraphPaged.ps1 index c2a510e..59f55f2 100644 --- a/EntraReporter/internal/functions/Invoke-GraphPaged.ps1 +++ b/EntraReporter/internal/functions/Invoke-GraphPaged.ps1 @@ -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 diff --git a/EntraReporter/internal/functions/Split-ArrayIntoChunks.ps1 b/EntraReporter/internal/functions/Split-ArrayIntoChunk.ps1 similarity index 91% rename from EntraReporter/internal/functions/Split-ArrayIntoChunks.ps1 rename to EntraReporter/internal/functions/Split-ArrayIntoChunk.ps1 index fe6234c..702ec3e 100644 --- a/EntraReporter/internal/functions/Split-ArrayIntoChunks.ps1 +++ b/EntraReporter/internal/functions/Split-ArrayIntoChunk.ps1 @@ -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()] diff --git a/EntraReporter/internal/functions/Test-GraphConnection.ps1 b/EntraReporter/internal/functions/Test-GraphConnection.ps1 index aec16ec..d6fc685 100644 --- a/EntraReporter/internal/functions/Test-GraphConnection.ps1 +++ b/EntraReporter/internal/functions/Test-GraphConnection.ps1 @@ -10,6 +10,7 @@ #> function Test-GraphConnection { [CmdletBinding()] + [OutputType([System.Boolean])] param () # Check if Graph module is installed