From 0ffae6f8947e094f65bb051b279d489f20564efd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 11:30:10 +0000 Subject: [PATCH 1/3] Initial plan From 974570a37038386f427e4a5584e677bc84837366 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 11:34:09 +0000 Subject: [PATCH 2/3] fix: include EntitlementManagement.Read.All in default graph scopes Agent-Logs-Url: https://github.com/maester365/maester/sessions/85f3c455-e40c-400c-b96f-9d2bde2d8696 Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com> --- powershell/public/Get-MtGraphScope.ps1 | 1 + .../functions/Get-MtGraphScope.Tests.ps1 | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 powershell/tests/functions/Get-MtGraphScope.Tests.ps1 diff --git a/powershell/public/Get-MtGraphScope.ps1 b/powershell/public/Get-MtGraphScope.ps1 index 4ca810c02..37a53d52b 100644 --- a/powershell/public/Get-MtGraphScope.ps1 +++ b/powershell/public/Get-MtGraphScope.ps1 @@ -57,6 +57,7 @@ 'DeviceManagementServiceConfig.Read.All' 'Directory.Read.All' 'DirectoryRecommendations.Read.All' + 'EntitlementManagement.Read.All' 'IdentityRiskEvent.Read.All' 'OnPremDirectorySynchronization.Read.All' 'OrgSettings-AppsAndServices.Read.All' diff --git a/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 b/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 new file mode 100644 index 000000000..d5d1cd1e5 --- /dev/null +++ b/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 @@ -0,0 +1,21 @@ +Describe 'Get-MtGraphScope' { + BeforeAll { + Import-Module $PSScriptRoot/../../Maester.psd1 -Force + } + + It 'Includes EntitlementManagement.Read.All in default scopes' { + $scopes = Get-MtGraphScope + + $scopes | Should -Contain 'EntitlementManagement.Read.All' + } + + It 'Keeps EntitlementManagement.Read.All in sorted position between DirectoryRecommendations and IdentityRiskEvent' { + $scopes = Get-MtGraphScope + $directoryRecommendationsIndex = $scopes.IndexOf('DirectoryRecommendations.Read.All') + $entitlementManagementIndex = $scopes.IndexOf('EntitlementManagement.Read.All') + $identityRiskEventIndex = $scopes.IndexOf('IdentityRiskEvent.Read.All') + + $directoryRecommendationsIndex | Should -BeLessThan $entitlementManagementIndex + $entitlementManagementIndex | Should -BeLessThan $identityRiskEventIndex + } +} From ba6429d7fdb43c24d53d37f65af6b45415e374d5 Mon Sep 17 00:00:00 2001 From: Sam Erde <20478745+SamErde@users.noreply.github.com> Date: Fri, 22 May 2026 07:55:57 -0400 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- powershell/tests/functions/Get-MtGraphScope.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 b/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 index d5d1cd1e5..94fe49e65 100644 --- a/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 +++ b/powershell/tests/functions/Get-MtGraphScope.Tests.ps1 @@ -11,9 +11,9 @@ Describe 'Get-MtGraphScope' { It 'Keeps EntitlementManagement.Read.All in sorted position between DirectoryRecommendations and IdentityRiskEvent' { $scopes = Get-MtGraphScope - $directoryRecommendationsIndex = $scopes.IndexOf('DirectoryRecommendations.Read.All') - $entitlementManagementIndex = $scopes.IndexOf('EntitlementManagement.Read.All') - $identityRiskEventIndex = $scopes.IndexOf('IdentityRiskEvent.Read.All') + $directoryRecommendationsIndex = [array]::IndexOf($scopes, 'DirectoryRecommendations.Read.All') + $entitlementManagementIndex = [array]::IndexOf($scopes, 'EntitlementManagement.Read.All') + $identityRiskEventIndex = [array]::IndexOf($scopes, 'IdentityRiskEvent.Read.All') $directoryRecommendationsIndex | Should -BeLessThan $entitlementManagementIndex $entitlementManagementIndex | Should -BeLessThan $identityRiskEventIndex