Skip to content

Commit

Permalink
Merge branch 'Dev' into NewProperty-TeamsMessagingPolicy-#4021
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Dec 29, 2023
2 parents 7feb89d + 3a116be commit 076c318
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Change log for Microsoft365DSC

# 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)
* SPOTenantSettings
* Fix bug for DisabledWebPartIds type, should be an array instead of a string
FIXES [#4086](https://github.com/microsoft/Microsoft365DSC/issues/4086)
* TeamsMessagingPolicy
* Added support for property 'AllowVideoMessages'
FIXES [#4021](https://github.com/microsoft/Microsoft365DSC/issues/4021)
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 @@ -120,6 +120,7 @@ function Get-TargetResource
if (![String]::IsNullOrEmpty($OmaSettingPlainTextValue))
{
$currentomaSettings.value = $OmaSettingPlainTextValue
$currentomaSettings.isEncrypted = $false
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MSFT_SPOTenantSettings : OMI_BaseResource
[Write, Description("To enable or disable Sync button on Team sites")] boolean HideSyncButtonOnTeamSite;
[Write, Description("Allow or block external sharing until at least one Office DLP policy scans the content of the file."), ValueMap{"AllowExternalSharing","BlockExternalSharing"}, Values{"AllowExternalSharing","BlockExternalSharing"}] string MarkNewFilesSensitiveByDefault;
[Write, Description("Allow or Block Conditional Access Policy on the SharePoint Tenant"), ValueMap{"AllowFullAccess", "AllowLimitedAccess", "BlockAccess"}, Values{"AllowFullAccess", "AllowLimitedAccess", "BlockAccess"}] string ConditionalAccessPolicy;
[Write, Description("Provide GUID for the Web Parts that are to be disabled on the Sharepoint Site")] string DisabledWebPartIds;
[Write, Description("Provide GUID for the Web Parts that are to be disabled on the Sharepoint Site")] string DisabledWebPartIds[];
[Write, Description("Set to false to enable a comment section on all site pages, users who have access to the pages can leave comments. Set to true to disable this feature.")] boolean CommentsOnSitePagesDisabled;
[Write, Description("Only accepted value is 'Present'."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Credentials of the account to authenticate with."), EmbeddedInstance("MSFT_Credential")] string Credential;
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 076c318

Please sign in to comment.