Skip to content

Commit

Permalink
Update ./scripts/TasksUpdater/Updater P2 Scheduler WU, SU, PS and Cle…
Browse files Browse the repository at this point in the history
…aner.ps1
  • Loading branch information
P6g9YHK6 committed Dec 17, 2024
1 parent 31ae3cb commit d0aed6e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit d0aed6e

Please sign in to comment.