Skip to content

Commit

Permalink
Merge pull request #1306 from nichxlxs/patch-2
Browse files Browse the repository at this point in the history
Fix TotalArchiveItemSize in ListUserMailboxDetails
  • Loading branch information
KelvinTegelaar authored Feb 24, 2025
2 parents ba7acc6 + 0d06280 commit 3d4839e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ Function Invoke-ListUserMailboxDetails {
$TotalItemSize = try { [math]::Round([float]($TotalItemSizeString[0]) / $ItemSizeType, 2) } catch { 0 }

if ($ArchiveEnabled) {
$ArchiveSizeType = '1{0}' -f ($TotalArchiveItemSizeString[1] ?? 'Gb')
$TotalArchiveItemSize = [math]::Round([float]($TotalArchiveItemSizeString[0]) / $ArchiveSizeType, 2)
$TotalArchiveItemSize = try { [math]::Round([float]($TotalArchiveItemSizeString[0]), 2) } catch { 0 }
$TotalArchiveItemCount = try { [math]::Round($ArchiveSizeRequest.ItemCount, 2) } catch { 0 }
}

# Build the GraphRequest object
Expand All @@ -177,8 +177,8 @@ Function Invoke-ListUserMailboxDetails {
ProhibitSendReceiveQuota = $ProhibitSendReceiveQuota
ItemCount = [math]::Round($StatsRequest.ItemCount, 2)
TotalItemSize = $TotalItemSize
TotalArchiveItemSize = if ($ArchiveEnabled) { $TotalArchiveItemSize } else { '0' }
TotalArchiveItemCount = if ($ArchiveEnabled) { try { [math]::Round($ArchiveSizeRequest.ItemCount, 2) } catch { 0 } } else { 0 }
TotalArchiveItemSize = $TotalArchiveItemSize
TotalArchiveItemCount = $TotalArchiveItemCount
BlockedForSpam = $BlockedForSpam
ArchiveMailBox = $ArchiveEnabled
AutoExpandingArchive = $AutoExpandingArchiveEnabled
Expand Down

0 comments on commit 3d4839e

Please sign in to comment.