Skip to content

Commit

Permalink
Merge pull request #2640 from NikCharlebois/Fixes-#2639
Browse files Browse the repository at this point in the history
Fixes #2639
  • Loading branch information
NikCharlebois authored Dec 8, 2022
2 parents d73f86b + df1d42d commit d8eb9a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* TeamsChannel
* Fixes an issue where channels weren't created if a non-existing GroupId was specified.
FIXES [#2622](https://github.com/microsoft/Microsoft365DSC/issues/2622)
* TeamsUpdateManagementPolicy
* Fixed error with the export that wasn't properly returning the UpdateTimeOfDay if not in short time string format.
FIXES [#2639](https://github.com/microsoft/Microsoft365DSC/issues/2639)
* DEPENDENCIES
* Updated MSCloudLoginAssistant to version 1.0.99;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,26 @@ function Get-TargetResource
}

Write-Verbose -Message "Found Teams Update Management Policy with Identity {$Identity}"
return @{
$results = @{
Identity = $policy.Identity
Description = $policy.Description
AllowManagedUpdates = $policy.AllowManagedUpdates
AllowPreview = $policy.AllowPreview
AllowPublicPreview = $policy.AllowPublicPreview
UpdateDayOfWeek = $policy.UpdateDayOfWeek
UpdateTime = $policy.UpdateTime
UpdateTimeOfDay = $policy.UpdateTimeOfDay.Split('T')[1].Replace('Z', '')
Ensure = 'Present'
Credential = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
if (-not [System.String]::IsNullOrEmpty($policy.UpdateTimeOfDay))
{
$updateTimeOfDayValue = $policy.UpdateTimeOfDay.ToShortTimeString()
$results.Add('UpdateTimeOfDay', $updateTimeOfDayValue)
}
return $results
}
catch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
BeforeAll {
$secpasswd = ConvertTo-SecureString 'Pass@word1' -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin', $secpasswd)

$DateTimeValue = [System.DateTime]::Parse("2022-12-08 6:00:00PM")
$Global:PartialExportFileName = 'c:\TestPath'
Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith {
return @{}
Expand Down Expand Up @@ -66,7 +66,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'Tag:TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '18:00:00'
UpdateTimeOfDay = '6:00 PM'
Ensure = 'Present'
Credential = $Credential
}
Expand Down Expand Up @@ -100,7 +100,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '18:00:00'
UpdateTimeOfDay = '6:00 PM'
Ensure = 'Present'
Credential = $Credential
}
Expand All @@ -114,7 +114,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'TestPolicy'
UpdateDayOfWeek = 3; #Drift
UpdateTime = '18:00'
UpdateTimeOfDay = '2022-05-06T18:00:00'
UpdateTimeOfDay = $DateTimeValue
}
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'Tag:TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '18:00:00'
UpdateTimeOfDay = '6:00 PM'
Ensure = 'Present'
Credential = $Credential
}
Expand All @@ -158,7 +158,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'Tag:TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '2022-05-06T18:00:00'
UpdateTimeOfDay = $DateTimeValue
}
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'Tag:TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '2022-05-06T18:00:00'
UpdateTimeOfDay = $DateTimeValue
}
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Identity = 'Tag:TestPolicy'
UpdateDayOfWeek = 1
UpdateTime = '18:00'
UpdateTimeOfDay = '2022-05-06T18:00:00'
UpdateTimeOfDay = $DateTimeValue
}
}
}
Expand Down

0 comments on commit d8eb9a4

Please sign in to comment.