With the code like this:
param ( [Parameter(Mandatory = $true)] [string]$TenantId, [Parameter(Mandatory = $true)] [System.Uri]$HostUrl,