diff --git a/Public/Get-O365TenantID.ps1 b/Public/Get-O365TenantID.ps1 index 285247032..6b7cb4228 100644 --- a/Public/Get-O365TenantID.ps1 +++ b/Public/Get-O365TenantID.ps1 @@ -17,8 +17,10 @@ #> [cmdletbinding()] param( - [parameter(Mandatory)][string] $Domain + [parameter(Mandatory)][alias('DomainName')][string] $Domain ) - (Invoke-RestMethod "https://login.windows.net/$Domain/.well-known/openid-configuration" -Method GET).userinfo_endpoint.Split("/")[3] -} - + $Invoke = Invoke-RestMethod "https://login.windows.net/$Domain/.well-known/openid-configuration" -Method GET -Verbose:$false + if ($Invoke) { + $Invoke.userinfo_endpoint.Split("/")[3] + } +} \ No newline at end of file