Clean Up
This commit is contained in:
@@ -192,9 +192,6 @@ try {
|
||||
continue
|
||||
}
|
||||
|
||||
#Inicializace dne
|
||||
$ds_shift_inplace = $false
|
||||
|
||||
#Množina emailů pro tento den v týdnu co mají mít home office
|
||||
$ho_emails = $schedule.($dayDate.DayOfWeek.ToString().ToLower()).'ho'
|
||||
|
||||
@@ -229,7 +226,7 @@ try {
|
||||
foreach ($email in $allemails) {
|
||||
$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)
|
||||
continue;
|
||||
}
|
||||
@@ -273,17 +270,17 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
$params = @{
|
||||
notifyTeam = $false
|
||||
startDateTime = [System.DateTime]::Parse($startSpanDate.ToString("yyyy-MM-dd'T'HH:mm:ssZ"))
|
||||
endDateTime = [System.DateTime]::Parse($endSpanDate.ToString("yyyy-MM-dd'T'HH:mm:ssZ"))
|
||||
}
|
||||
|
||||
Invoke-MgShareTeamSchedule -TeamId $team.Id -BodyParameter $params -Headers @{ "MS-APP-ACTS-AS" = $userIdAdmin }
|
||||
("SHARING: {0}" -f $scheduleGroupName) | Add-Content -Path $logPath
|
||||
|
||||
$params = @{
|
||||
notifyTeam = $false
|
||||
startDateTime = [System.DateTime]::Parse($startSpanDate.ToString("yyyy-MM-dd'T'HH:mm:ssZ"))
|
||||
endDateTime = [System.DateTime]::Parse($endSpanDate.ToString("yyyy-MM-dd'T'HH:mm:ssZ"))
|
||||
}
|
||||
catch {
|
||||
$_
|
||||
break;
|
||||
}
|
||||
|
||||
Invoke-MgShareTeamSchedule -TeamId $team.Id -BodyParameter $params -Headers @{ "MS-APP-ACTS-AS" = $userIdAdmin }
|
||||
("SHARING: {0}" -f $scheduleGroupName) | Add-Content -Path $logPath
|
||||
|
||||
}
|
||||
catch {
|
||||
$_
|
||||
break;
|
||||
}
|
Reference in New Issue
Block a user