Don't have Telegram yet? Try it now!
https://sqldbawithabeard.com/2017/04/10/export-sql-user-permissions-to-t-sql-script-using-powershell-and-dbatools/
Export SQL User Permissions to T-SQL script using PowerShell and dbatools