Skip to content

Commit 355af0a

Browse files
ShanefeCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent cda76e2 commit 355af0a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Calendar/Check-SharingStatus.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ function ProcessCalendarSharingAcceptLogs {
129129
Write-Host "Collecting AcceptCalendarSharingInvite logs for [$Identity] ..."
130130
$logOutput = Export-MailboxDiagnosticLogs $Identity -ComponentName AcceptCalendarSharingInvite
131131
} catch {
132-
Write-Warning "No AcceptCalendarSharingInvite logs found for [$Identity]."
132+
$errorMessage = $_.Exception.Message
133+
if ($errorMessage -match "(?i)not\s+found|no\s+logs") {
134+
Write-Warning "No AcceptCalendarSharingInvite logs found for [$Identity]. Details: $errorMessage"
135+
return
136+
}
137+
138+
throw "Failed to collect AcceptCalendarSharingInvite logs for [$Identity]: $errorMessage"
133139
}
134140

135141
# check if the output is empty

0 commit comments

Comments
 (0)