It would be nice if you added support for Azure Government, Office 365 GCC High and Intune Government. I don't think you would have to change much in terms of the code other than the urls you are connecting to.
Azure Government - portal.azure.us
Office 365 GCC High - outlook.office365.us (your site says you connect to outlook.office.com)
Intune Government - endpoint.microsoft.us
If you are using powershell most of it is down with a simple switch "environment" and setting it there.