I was testing your Get-Office365Forwarders script, and noticed that you check if the MSOnline and ExchangeOnlineManagement are installed but you never actually import them in your script causing the Connect-MsolService to fail as the function doesn't exist.