Skip to content

Commit

Permalink
Function improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Aug 19, 2021
1 parent d38201f commit 3039927
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Public/Get-O365TenantID.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

0 comments on commit 3039927

Please sign in to comment.