From 6af5730284c4bbb536bab369911b603b43c95f5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:45:11 +0000 Subject: [PATCH 1/2] Initial plan From 4c2525433e7b63da4e809c48d408326d74e1cafe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:51:03 +0000 Subject: [PATCH 2/2] Add support for RecurType 6 (SMS_ST_RecurMonthlyByWeekdayBase) Co-authored-by: CodyMathis123 <28543620+CodyMathis123@users.noreply.github.com> --- Source/Public/ConvertFrom-CCMSchedule.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Source/Public/ConvertFrom-CCMSchedule.ps1 b/Source/Public/ConvertFrom-CCMSchedule.ps1 index ea849c6..733853f 100644 --- a/Source/Public/ConvertFrom-CCMSchedule.ps1 +++ b/Source/Public/ConvertFrom-CCMSchedule.ps1 @@ -12,6 +12,7 @@ Function ConvertFrom-CCMSchedule { 3 = 'SMS_ST_RecurWeekly' 4 = 'SMS_ST_RecurMonthlyByWeekday' 5 = 'SMS_ST_RecurMonthlyByDate' + 6 = 'SMS_ST_RecurMonthlyByWeekdayBase' } #endregion TypeMap for returning readable window type @@ -187,6 +188,25 @@ Function ConvertFrom-CCMSchedule { $MW['ForNumberOfMonths'] = $ForNumberOfMonths $MW['MonthDay'] = $MonthDay } + 6 { + $Day = [Convert]::ToInt32($binaryRecurrence.Substring(13, 3), 2) + $ForNumberOfMonths = [Convert]::ToInt32($binaryRecurrence.Substring(16, 4), 2) + $WeekOrder = [Convert]::ToInt32($binaryRecurrence.Substring(20, 3), 2) + $OffsetDay = [Convert]::ToInt32($binaryRecurrence.Substring(23, 3), 2) + $WeekRecurrence = switch ($WeekOrder) { + 0 { + 'Last' + } + default { + $(Get-FancyDay -Day $WeekOrder) + } + } + $MW['Description'] = [string]::Format('Occurs the {0} {1} of every {2} months with {3} day offset effective {4}', $WeekRecurrence, $([DayOfWeek]($Day - 1)), $ForNumberOfMonths, $OffsetDay, $StartDateTimeObject) + $MW['Day'] = $Day + $MW['ForNumberOfMonths'] = $ForNumberOfMonths + $MW['WeekOrder'] = $WeekOrder + $MW['OffsetDay'] = $OffsetDay + } Default { Write-Error "Parsing Schedule String resulted in invalid type of $RecurType" }