This commit is contained in:
Jonatan Rek
2025-10-14 18:44:09 +02:00
parent 1a7ba16c85
commit d5ab85739d

View File

@@ -192,9 +192,6 @@ try {
continue continue
} }
#Inicializace dne
$ds_shift_inplace = $false
#Množina emailů pro tento den v týdnu co mají mít home office #Množina emailů pro tento den v týdnu co mají mít home office
$ho_emails = $schedule.($dayDate.DayOfWeek.ToString().ToLower()).'ho' $ho_emails = $schedule.($dayDate.DayOfWeek.ToString().ToLower()).'ho'
@@ -229,7 +226,7 @@ try {
foreach ($email in $allemails) { foreach ($email in $allemails) {
$userId = $(Get-MgUser -Filter "UserPrincipalName eq '$email' or proxyAddresses/any(c:c eq 'smtp:$email')").Id $userId = $(Get-MgUser -Filter "UserPrincipalName eq '$email' or proxyAddresses/any(c:c eq 'smtp:$email')").Id
if ($userId -in $shifts_today.UserId){ if ($userId -in $shifts_today.UserId) {
Write-Debug ("{0} has Manual Shift" -f $email) Write-Debug ("{0} has Manual Shift" -f $email)
continue; continue;
} }
@@ -282,8 +279,8 @@ try {
Invoke-MgShareTeamSchedule -TeamId $team.Id -BodyParameter $params -Headers @{ "MS-APP-ACTS-AS" = $userIdAdmin } Invoke-MgShareTeamSchedule -TeamId $team.Id -BodyParameter $params -Headers @{ "MS-APP-ACTS-AS" = $userIdAdmin }
("SHARING: {0}" -f $scheduleGroupName) | Add-Content -Path $logPath ("SHARING: {0}" -f $scheduleGroupName) | Add-Content -Path $logPath
} }
catch { catch {
$_ $_
break; break;
} }