If you're working with Exchange Online and other Microsoft Online services, chances are you probably use the same set of cmdlets over and over again. To minimze the amount of repetitive typing required just to get started, here's the PowerShell profile script that i use that will do all the prep work for you:
Switch to your preferred script directory (don't forget to modify the path)
Store your MS Online credentials (in $OnlineCred variable)
Create a PowerShell session to Exchange Online
Check for presence of msonline module and load it, if present (or display a message if it's not)
Check for presence of MS Online Directory Synchronization snap-in and load it, if present (or display a message if it's not)
Check for presence of Active Directory module and load it, if present (or display a message if it's not)
Change the title of the PowerShell window to show your MS Online user id and also which modules have been loaded (Microsoft.Exchange, msonline, dirsync, active directory)
Download the profile script from attachments area
To use the profile, fire up Powershell, then run these commands (don't overwrite, unintentionally, an existing profile by running notepad $profile - if a file opens up, make sure there's nothing there you want):
new-item -type file -path $profile -force
Open the downloaded profile.txt, copy and paste its contents into the profile script you just opened - modify the script start directory (2nd line) first, though (or comment it out). Save the file and exit Powershell.
When you start it up again (make sure to run it as Administrator), it'll run all the commands in the script and get your work environment ready for MS Online administration tasks!
Note that you may get an execution policy error:
Execute the following command:
...and confirm when prompted. Restart powershell (again, as Administrator), and the script will execute. Submit a helpdesk ticket if you need any help!