diff --git a/powershell/public/services/exchange/Get-MtExo.ps1 b/powershell/public/services/exchange/Get-MtExo.ps1 index f78d5f7209..9fc29da7e7 100644 --- a/powershell/public/services/exchange/Get-MtExo.ps1 +++ b/powershell/public/services/exchange/Get-MtExo.ps1 @@ -36,7 +36,7 @@ ### - add them to the hashtable below ### - confirm the command's return type is in OutputType (e.g. (Get-AcceptedDomain).GetType().Name) $commands = @{ - "AcceptedDomain" = "Get-AcceptedDomain" + "AcceptedDomain" = "Get-AcceptedDomain -ResultSize 'Unlimited'" "RemoteDomain" = "Get-RemoteDomain" "TransportConfig" = "Get-TransportConfig" "TransportRule" = "Get-TransportRule" diff --git a/powershell/tests/functions/Get-MtExo.Tests.ps1 b/powershell/tests/functions/Get-MtExo.Tests.ps1 index d2f2fc4a7d..db1d0efd52 100644 --- a/powershell/tests/functions/Get-MtExo.Tests.ps1 +++ b/powershell/tests/functions/Get-MtExo.Tests.ps1 @@ -25,10 +25,17 @@ [PSCustomObject]@{ UserPrincipalName = 'vip@example.test'; IsVIP = $IsVIP.IsPresent; ResultSize = $ResultSize } } } | Import-Module -Global -Force + New-Module -Name tmpEXO_domain_mttest -ScriptBlock { + function Get-AcceptedDomain { + [CmdletBinding()] + param([string]$ResultSize) + [PSCustomObject]@{ Name = 'contoso.com'; ResultSize = $ResultSize } + } + } | Import-Module -Global -Force } AfterAll { - Remove-Module tmpEXO_restricted_mttest, tmpEXO_mttest, tmpEOP_mttest, tmpEXO_vip_mttest -Force -ErrorAction SilentlyContinue + Remove-Module tmpEXO_restricted_mttest, tmpEXO_mttest, tmpEOP_mttest, tmpEXO_vip_mttest, tmpEXO_domain_mttest -Force -ErrorAction SilentlyContinue Clear-MtExoCache } @@ -74,4 +81,11 @@ $vipUsers[0].IsVIP | Should -BeTrue $vipUsers[0].ResultSize | Should -Be 'Unlimited' } + + It 'Requests every accepted domain' { + $domains = @(Get-MtExo -Request AcceptedDomain) + + $domains.Count | Should -Be 1 + $domains[0].ResultSize | Should -Be 'Unlimited' + } }