diff --git a/CHANGELOG.md b/CHANGELOG.md index ee935f5..433edc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,17 +5,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.2.0 (2026-04-04) +## 0.3.0 (2026-04-05) + +### Added + +- Support for Windows PowerShell 5.1 ### Fixed -- List of required Graph scopes was missing scopes. +- Casing inside link to CHANGELOG.md in manifest. + +## 0.2.0 (2026-04-04) ### Added - Better error handling due to missing permissions or unknown objects - Requirement for module 'Microsoft.Graph.Authentication' +### Fixed + +- List of required Graph scopes was missing scopes. + ## 0.1.0 (2026-04-03) ### Added diff --git a/EntraReporter/EntraReporter.psd1 b/EntraReporter/EntraReporter.psd1 index ca164a0..7d2a15c 100644 --- a/EntraReporter/EntraReporter.psd1 +++ b/EntraReporter/EntraReporter.psd1 @@ -1,31 +1,31 @@ @{ # Script module or binary module file associated with this manifest. - RootModule = 'EntraReporter.psm1' + RootModule = 'EntraReporter.psm1' # Version number of this module. - ModuleVersion = '0.2.0' + ModuleVersion = '0.3.0' # Supported PSEditions - # CompatiblePSEditions = @() + CompatiblePSEditions = @('Core', 'Desktop') # ID used to uniquely identify this module - GUID = '0d751943-6d57-43b3-8b3e-61998116ce59' + GUID = '0d751943-6d57-43b3-8b3e-61998116ce59' # Author of this module - Author = 'Kåre Overgård' + Author = 'Kåre Overgård' # Company or vendor of this module - CompanyName = '& Overgård' + CompanyName = '& Overgård' # Copyright statement for this module - Copyright = '(c) Kåre Overgård. All rights reserved.' + Copyright = '(c) Kåre Overgård. All rights reserved.' # Description of the functionality provided by this module - Description = 'PowerShell module for generating reports about Entra ID.' + Description = 'PowerShell module for generating reports about Entra ID.' # Minimum version of the PowerShell engine required by this module - # PowerShellVersion = '' + PowerShellVersion = '5.1' # Name of the PowerShell host required by this module # PowerShellHostName = '' @@ -43,7 +43,7 @@ # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module - RequiredModules = @( + RequiredModules = @( 'Microsoft.Graph.Authentication' ) @@ -57,7 +57,7 @@ # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module - FormatsToProcess = @( + FormatsToProcess = @( 'EntraReporter.RoleAssignment.Format.ps1xml' ) @@ -65,19 +65,19 @@ # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. - FunctionsToExport = @( + FunctionsToExport = @( 'Get-EntraIdLevel', 'Get-EntraIdRoleAssignment' ) # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. - CmdletsToExport = @() + CmdletsToExport = @() # Variables to export from this module # VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. - AliasesToExport = @() + AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() @@ -89,7 +89,7 @@ # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. - PrivateData = @{ + PrivateData = @{ PSData = @{ @@ -106,7 +106,7 @@ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = 'https://github.com/kovergard/EntraReporter/blob/main/changelog.md' + ReleaseNotes = 'https://github.com/kovergard/EntraReporter/blob/main/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' diff --git a/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 b/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 index 97dd39e..94a7d9a 100644 --- a/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 +++ b/EntraReporter/functions/Get-EntraIdRoleAssignment.ps1 @@ -182,7 +182,7 @@ function Get-EntraIdRoleAssignment { PrincipalId = $Schedule.principal.id PrincipalDisplayName = $Schedule.principal.displayName AssignmentType = 'Group' - Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName + Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName PrincipalState = $GroupState PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null } PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null } @@ -235,7 +235,7 @@ function Get-EntraIdRoleAssignment { PrincipalId = $Schedule.principal.id PrincipalDisplayName = $Schedule.principal.displayName AssignmentType = 'User' - Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName + Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName PrincipalState = $State PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null } PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null } @@ -256,7 +256,7 @@ function Get-EntraIdRoleAssignment { PrincipalId = $Schedule.principal.id PrincipalDisplayName = $Schedule.principal.displayName AssignmentType = 'Service principal' - Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName + Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName PrincipalState = $State PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null } PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null } @@ -308,9 +308,9 @@ function Get-EntraIdRoleAssignment { # Fetch all role schedules, assigned and eligible. Write-Progress -Activity $activityName -Status 'Fetching assigned role schedules' -PercentComplete 20 - $roleAssignmentSchedules = Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleAssignmentSchedules?`$filter=assignmentType eq 'Assigned'&`$expand=principal,roleDefinition" -Verbose:$false | Select-Object -ExpandProperty value + $roleAssignmentSchedules = (Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleAssignmentSchedules?`$filter=assignmentType eq 'Assigned'&`$expand=principal,roleDefinition" -Verbose:$false)['value'] Write-Progress -Activity $activityName -Status 'Fetching eligible role schedules' -PercentComplete 40 - $roleEligibilitySchedules = Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleEligibilitySchedules?`$expand=principal,roleDefinition" -Verbose:$false | Select-Object -ExpandProperty value + $roleEligibilitySchedules = (Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleEligibilitySchedules?`$expand=principal,roleDefinition" -Verbose:$false)['value'] # If Rolename has been specified, filter out any assigments not in the specified role(s). if ($RoleName) { @@ -324,8 +324,8 @@ function Get-EntraIdRoleAssignment { # Extract unique group IDs from all role schedules for prefetching group schedule information in bulk to reduce number of API calls later on. $groupIds = @() - $groupIds += $roleAssignmentSchedules | Select-Object -ExpandProperty principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' } | Select-Object -ExpandProperty Id - $groupIds += $roleEligibilitySchedules | Select-Object -ExpandProperty principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' } | Select-Object -ExpandProperty Id + $groupIds += ($roleAssignmentSchedules.principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' }).Id + $groupIds += ($roleEligibilitySchedules.principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' }).Id $groupIds = $groupIds | Select-Object -Unique # Prefetch group schedules for all groups used groups diff --git a/EntraReporter/internal/functions/Get-AdministrativeUnit.ps1 b/EntraReporter/internal/functions/Get-AdministrativeUnit.ps1 index f1f7035..9b19629 100644 --- a/EntraReporter/internal/functions/Get-AdministrativeUnit.ps1 +++ b/EntraReporter/internal/functions/Get-AdministrativeUnit.ps1 @@ -28,7 +28,7 @@ function Get-AdministrativeUnit { $results = @() # Get all administrative units from directory to avoid making multiple calls - $allAdministrativeUnits = Invoke-MgGraphRequest -Method GET -Uri 'v1.0/directory/administrativeUnits' -Verbose:$false | Select-Object -ExpandProperty value + $allAdministrativeUnits = (Invoke-MgGraphRequest -Method GET -Uri 'v1.0/directory/administrativeUnits' -Verbose:$false)['value'] foreach ($adminUnit in $allAdministrativeUnits) { $results += [pscustomobject] @{ directoryScopeId = "/administrativeUnits/$($adminUnit.id)"