From a23724003c0503a291f74864a0d3be6501a9e666 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 29 Nov 2024 12:11:54 -0500 Subject: [PATCH 1/2] AADRoleManagementPolicyRule - Added Filter Logic for Export --- CHANGELOG.md | 2 ++ .../MSFT_AADRoleManagementPolicyRule.psm1 | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a359f60c..1435c713f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * All resources * Applying project default formatting on all files, to improve reading and troubleshooting +* AADRoleManagementPolicyRule + * Added the logic to handle filters in the Export logic flow. * EXOTransportRule * Fixed conditional logic for creation and update. * IntuneTrustedRootCertificateIOS diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 index a8eedd64a4..7df953abbe 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 @@ -119,6 +119,7 @@ function Get-TargetResource $rule = Get-M365DSCRoleManagementPolicyRuleObject -Rule $getValue $results = @{ +<<<<<<< Updated upstream id = $id policyId = $policyId roleDisplayName = $roleDisplayName @@ -127,6 +128,16 @@ function Get-TargetResource notificationRule = $rule.notificationRule enablementRule = $rule.enablementRule approvalRule = $rule.approvalRule +======= + id = $id + policyId = $policyId + roleDisplayName = $roleDisplayName + ruleType = $rule.ruleType + expirationRule = $rule.expirationRule + notificationRule = $rule.notificationRule + enablementRule = $rule.enablementRule + approvalRule = $rule.approvalRule +>>>>>>> Stashed changes authenticationContextRule = $rule.authenticationContextRule Credential = $Credential ApplicationId = $ApplicationId @@ -487,7 +498,11 @@ function Export-TargetResource Write-Host "`r`n" -NoNewline try { +<<<<<<< Updated upstream [array] $roles = Get-MgBetaRoleManagementDirectoryRoleDefinition -All +======= + [array] $roles = Get-MgBetaRoleManagementDirectoryRoleDefinition -Filter $Filter -All +>>>>>>> Stashed changes $j = 1 foreach ($role in $roles) From aad2ad1e0d2dc8ede02f553b2c4424cc1e7d3ea8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 29 Nov 2024 12:15:44 -0500 Subject: [PATCH 2/2] AADRoleManagementPolicyRule - Added Filter Logic for Export --- .../MSFT_AADRoleManagementPolicyRule.psm1 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 index 7df953abbe..d6105f337d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleManagementPolicyRule/MSFT_AADRoleManagementPolicyRule.psm1 @@ -119,7 +119,6 @@ function Get-TargetResource $rule = Get-M365DSCRoleManagementPolicyRuleObject -Rule $getValue $results = @{ -<<<<<<< Updated upstream id = $id policyId = $policyId roleDisplayName = $roleDisplayName @@ -128,16 +127,6 @@ function Get-TargetResource notificationRule = $rule.notificationRule enablementRule = $rule.enablementRule approvalRule = $rule.approvalRule -======= - id = $id - policyId = $policyId - roleDisplayName = $roleDisplayName - ruleType = $rule.ruleType - expirationRule = $rule.expirationRule - notificationRule = $rule.notificationRule - enablementRule = $rule.enablementRule - approvalRule = $rule.approvalRule ->>>>>>> Stashed changes authenticationContextRule = $rule.authenticationContextRule Credential = $Credential ApplicationId = $ApplicationId @@ -498,11 +487,7 @@ function Export-TargetResource Write-Host "`r`n" -NoNewline try { -<<<<<<< Updated upstream - [array] $roles = Get-MgBetaRoleManagementDirectoryRoleDefinition -All -======= [array] $roles = Get-MgBetaRoleManagementDirectoryRoleDefinition -Filter $Filter -All ->>>>>>> Stashed changes $j = 1 foreach ($role in $roles)