Skip to content

Instantly share code, notes, and snippets.

@mattruma
Last active April 30, 2020 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattruma/5f312fe2fff094ed63d394ed407c396d to your computer and use it in GitHub Desktop.
Save mattruma/5f312fe2fff094ed63d394ed407c396d to your computer and use it in GitHub Desktop.
param (
[string]$Tenant
)
If ($Tenant.Trim() -eq "" ) {
$Tenant = Read-Host -Prompt "Enter your FIRST part of your tenant name, e.g. if your tenant was microsoft.onmicrosoft.com, just enter microsoft"
}
If ($Tenant.Trim() -eq "" ) {
Throw "Tenant is required, either enter as a prompt or provide a value for the -Tenant argument"
}
Connect-AzAccount -Tenant "$($Tenant).onmicrosoft.com"
az login --tenant "$($Tenant).onmicrosoft.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment