From d45445ce633e9e8c94d7b96a6707de9cc0d749d8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 17 Dec 2024 15:47:13 -0500 Subject: [PATCH 1/2] AADApplication - Fix Permission Evaluation --- CHANGELOG.md | 1 + .../DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4dc1e40bc..c9428db8ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * AADApplication * Added support for Oauth2PermissionScopes. + * Fixes comparison issue for permissions. * TeamsMeetingPolicy * FIXES [#5550](https://github.com/microsoft/Microsoft365DSC/issues/5550) * MISC diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 index 72953ed80b..6619481744 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 @@ -1426,8 +1426,8 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters - if ($CurrentValues.Permissions.Length -gt 0 -and ` - $null -ne $CurrentValues.Permissions.Name) + if ($CurrentValues.Permissions.Length -gt 0 -and $null -ne $CurrentValues.Permissions.Name -and ` + $Permissions.Length -gt 0) { $differenceObject = $Permissions.Name if ($null -eq $differenceObject) From 8012e7de66f1c7c0463ba2f6b9181a521c8d994f Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 17 Dec 2024 16:01:25 -0500 Subject: [PATCH 2/2] Update MSFT_AADApplication.psm1 --- .../DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 index 6619481744..fd8647a090 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 @@ -1427,7 +1427,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters if ($CurrentValues.Permissions.Length -gt 0 -and $null -ne $CurrentValues.Permissions.Name -and ` - $Permissions.Length -gt 0) + $null -ne $Permissions) { $differenceObject = $Permissions.Name if ($null -eq $differenceObject)