Skip to content

Commit

Permalink
Merge branch 'Dev' into fix4083
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Dec 29, 2023
2 parents bf8d96a + bb8260c commit 081c5af
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# UNRELEASED

* EXOMailboxCalendarFolder
* Add support for non-English calendar folder names during export
FIXES [#4056](https://github.com/microsoft/Microsoft365DSC/issues/4056)
* IntuneDeviceConfigurationCustomPolicyWindows10
* Fix issue deploying decrypted OmaSettings to another tenant
FIXES [#4083](https://github.com/microsoft/Microsoft365DSC/issues/4083)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ function Export-TargetResource
$i = 1
foreach ($mailbox in $mailboxes)
{
$folderPath = $mailbox.UserPrincipalName + ':\Calendar'
# Name of calendar folder depends on the language of the mailbox
$calendarFolderName = (Get-MailboxFolderStatistics -Identity $($mailbox.UserPrincipalName) -FolderScope Calendar | Where-Object {$_.FolderType -eq 'Calendar'}).Name
$folderPath = $mailbox.UserPrincipalName + ':\' + $calendarFolderName
Write-Host " |---[$i/$($mailboxes.Count)] $($folderPath)" -NoNewline
$Params = @{
Identity = $folderPath
Expand Down Expand Up @@ -452,7 +454,6 @@ function Export-TargetResource
$i++
}


return $dscContent
}
catch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Credential = $Credential
}

Mock -CommandName Get-MailboxFolderStatistics -MockWith {
return @{
FolderType = "Calendar";
Name = "Calendar";
}
}

Mock -CommandName Get-MailboxCalendarFolder -MockWith {
return @{
DetailLevel = "AvailabilityOnly";
Expand All @@ -171,7 +178,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}
}


It 'Should Reverse Engineer resource from the Export method' {
$result = Export-TargetResource @testParams
$result | Should -Not -BeNullOrEmpty
Expand Down
13 changes: 13 additions & 0 deletions Tests/Unit/Stubs/Microsoft365.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,19 @@ function Get-MailboxCalendarFolder
$Identity
)
}
function Get-MailboxFolderStatistics
{
[CmdletBinding()]
param(
[Parameter()]
[System.Object]
$Identity,

[Parameter()]
[System.String]
$FolderScope
)
}
function Get-MailboxPermission
{
[CmdletBinding()]
Expand Down

0 comments on commit 081c5af

Please sign in to comment.