Skip to content

Commit

Permalink
refactor: exchange connection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
GruberMarkus committed Mar 16, 2024
1 parent dbcf8c0 commit 5f51c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Export-RecipientPermissions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ try {
try {
# Get-EXORecipient does not (yet) return allowed RecipientTypeDetails,
# so Get-Recipient is used for Exchange on-prem and Exchange Online
$null = $(. ([scriptblock]::Create($ConnectExchange)) -ScriptBlock { @( Get-Recipient -RecipientTypeDetails '!!!Fail!!!' -resultsize 1 -ErrorAction Stop -WarningAction silentlycontinue) })
$null = . ([scriptblock]::Create("@(Get-$($CmdletPrefix)Recipient -RecipientTypeDetails '!!!Fail!!!' -resultsize 1 -ErrorAction Stop -WarningAction silentlycontinue)")
} catch {
$null = $error[0].exception -match '(?!.*: )(.*)(")$'
$RecipientTypeDetailsListUnchecked = $matches[1].trim() -split ', ' | Where-Object { $_ } | Sort-Object -Unique
Expand Down

0 comments on commit 5f51c8e

Please sign in to comment.