From f01850d0c6f0174d45765a724942ecf765d06fea Mon Sep 17 00:00:00 2001 From: Philippe Kernevez Date: Tue, 14 Nov 2023 14:21:19 +0100 Subject: [PATCH 1/4] Application Ids are strings not objects --- CHANGELOG.md | 3 +++ .../MSFT_TeamsComplianceRecordingPolicy.psm1 | 2 +- .../1-TeamsComplianceRecordingPolicy-Example.ps1 | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a18d2f1e6..ebc1598681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,9 @@ * Added a QA check to test if all used subclasses actually exist in the MOF schema. * DEPENDENCIES * Updated Microsoft. Graph dependencies to version 2.9.0. +* TeamsTeam + * Fixes incompatible type for ComplianceRecordingApplications, expected string[] but receive object[] + FIXES: [#3890](https://github.com/microsoft/Microsoft365DSC/issues/3890) # 1.23.1108.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 index 14e0c8c493..896913588e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 @@ -81,7 +81,7 @@ function Get-TargetResource } $recordApplicationIds = @() foreach ($app in $recordingApplications) { - $recordApplicationIds += @{Id=$app.Id} + $recordApplicationIds += $app.Id } Write-Verbose -Message "Found an instance with Identity {$Identity}" diff --git a/Modules/Microsoft365DSC/Examples/Resources/TeamsComplianceRecordingPolicy/1-TeamsComplianceRecordingPolicy-Example.ps1 b/Modules/Microsoft365DSC/Examples/Resources/TeamsComplianceRecordingPolicy/1-TeamsComplianceRecordingPolicy-Example.ps1 index 0e67e0222e..2c979de26e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/TeamsComplianceRecordingPolicy/1-TeamsComplianceRecordingPolicy-Example.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/TeamsComplianceRecordingPolicy/1-TeamsComplianceRecordingPolicy-Example.ps1 @@ -16,7 +16,7 @@ Configuration Example { TeamsComplianceRecordingPolicy 'Example' { - ComplianceRecordingApplications = @(); + ComplianceRecordingApplications = @('qwertzuio-abcd-abcd-abcd-qwertzuio'); Credential = $Credscredential; DisableComplianceRecordingAudioNotificationForCalls = $False; Enabled = $False; From 7f31077a10050509707ca1c0f711f90f6267a5f6 Mon Sep 17 00:00:00 2001 From: Philippe Kernevez Date: Thu, 16 Nov 2023 08:10:42 +0100 Subject: [PATCH 2/4] Fix tests --- ...crosoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 index 6ea4b41bd0..a9b3c2da36 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 @@ -63,7 +63,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Description = 'FakeStringValue' Enabled = $True DisableComplianceRecordingAudioNotificationForCalls = $True - ComplianceRecordingApplications = @(@{Id="123456"}) + ComplianceRecordingApplications = @("123456") Identity = 'FakeStringValue' Ensure = 'Present' Credential = $Credential @@ -95,7 +95,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Description = 'FakeStringValue' Enabled = $True DisableComplianceRecordingAudioNotificationForCalls = $True - ComplianceRecordingApplications = @(@{Id='123456'}) + ComplianceRecordingApplications = @('123456') Identity = 'FakeStringValue' Ensure = 'Absent' Credential = $Credential @@ -147,7 +147,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Description = 'FakeStringValue' Enabled = $True DisableComplianceRecordingAudioNotificationForCalls = $True - ComplianceRecordingApplications = @(@{Id='123456'}) + ComplianceRecordingApplications = @('123456') Identity = 'FakeStringValue' Ensure = 'Present' Credential = $Credential @@ -184,7 +184,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Description = 'FakeStringValue' Enabled = $True DisableComplianceRecordingAudioNotificationForCalls = $True - ComplianceRecordingApplications = @{Id='123456'} + ComplianceRecordingApplications = @('123456') Identity = 'FakeStringValue' Ensure = 'Present' Credential = $Credential From d4cc1dee11cc4611c4fc16ebdda76d5e0bd5aede Mon Sep 17 00:00:00 2001 From: Philippe Kernevez Date: Thu, 16 Nov 2023 11:01:29 +0100 Subject: [PATCH 3/4] Fix 2nd part --- .../Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 index a9b3c2da36..beeb3ecff5 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsComplianceRecordingPolicy.Tests.ps1 @@ -124,7 +124,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $Result = (Get-TargetResource @testParams) $Result.Ensure | Should -Be 'Present' $Result.ComplianceRecordingApplications.Length | Should -Be 1 - $Result.ComplianceRecordingApplications[0].Id | Should -Be '123456' + $Result.ComplianceRecordingApplications[0] | Should -Be '123456' Should -Invoke -CommandName Get-CsTeamsComplianceRecordingPolicy -Exactly 1 Should -Invoke -CommandName Get-CsTeamsComplianceRecordingApplication -ParameterFilter {$Filter -eq 'FakeStringValue/*'} -Exactly 1 From 20d115887165d2d16869343dd31804e7542638e4 Mon Sep 17 00:00:00 2001 From: Philippe Kernevez Date: Tue, 28 Nov 2023 20:24:15 +0100 Subject: [PATCH 4/4] Fix merge --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc1598681..c29bf9e032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ * Updated DSCParser to version 1.4.0.1. * Updated Microsoft.Graph to version 2.10.0. * Updated MSCloudLoginAssistant to version 1.1.0. +* TeamsTeam + * Fixes incompatible type for ComplianceRecordingApplications, expected string[] but receive object[] + FIXES: [#3890](https://github.com/microsoft/Microsoft365DSC/issues/3890) # 1.23.1122.1 @@ -74,9 +77,6 @@ * Added a QA check to test if all used subclasses actually exist in the MOF schema. * DEPENDENCIES * Updated Microsoft. Graph dependencies to version 2.9.0. -* TeamsTeam - * Fixes incompatible type for ComplianceRecordingApplications, expected string[] but receive object[] - FIXES: [#3890](https://github.com/microsoft/Microsoft365DSC/issues/3890) # 1.23.1108.1