If you work with Office 365 through PowerShell, you probably have your own script to connect to the various services. If you don’t want to write your own script, you can download one from GitHub or the TechNet Gallery.
— Read on office365itpros.com/2019/03/01/configuring-powershell-office-365/