This PowerShell profile contains a function called "Connect-EXO" which will allow you to connect to both Exchange Online and Azure Active Directory.

The function is as follows:

Function Connect-EXO {Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Authentication Basic -AllowRedirection -Credential $UserCredential
Import-PSSession $sessionConnect-MsolService –Credential $UserCredential
}

Reference blog: https://supertekboy.com/2015/04/30/easily-connect-powershell-to-exchange-online/