From d0aed6e4005d0212c9d645bc9beb436411dc890e Mon Sep 17 00:00:00 2001 From: P6g9YHK6 <17877371+P6g9YHK6@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:02:07 +0000 Subject: [PATCH] Update ./scripts/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 --- .../Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts_staging/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 b/scripts_staging/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 index 5db5a083..fff4d4f5 100644 --- a/scripts_staging/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 +++ b/scripts_staging/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cleaner.ps1 @@ -29,7 +29,7 @@ .CHANGELOG 06.08.24 SAN Initial release for generating task dates based on monthly recurrence patterns. 12.12.24 SAN changed var names to make it clear that the template is used rather than the old current values, fixed empty values in the env var - + 17.12.24 SAN fixed cases where the date contained dashes .TODO Add error handling for invalid schedule formats. @@ -95,7 +95,8 @@ foreach ($schedule in $rawSchedules) { $updatedTime = $timeWithOffset.ToString("HH:mm:ss") # Format the date as MM/dd/yyyy - $formattedTaskDate = $taskDate.ToString("MM/dd/yyyy").Replace('.', '/') + $formattedTaskDate = $taskDate.ToString("MM/dd/yyyy").Replace('.', '/').Replace('-', '/') + # Replace the occurrence and day of the week in the schedule with the formatted date and time $updatedSchedule = $schedule -replace "(\d+)(st|nd|rd|th) (\w+) \d{2}:\d{2}:\d{2}", "$formattedTaskDate $updatedTime"