how to script out database users and permissions in all user databases in the instance

Can anyone help please?

I would like to use Steve Kusen’s script at https://www.sqlservercentral.com/forums/topic/script-db-level-permissions/page/4/#post-1954202

to loop through all the user databases automatically, using Aaron Bertrand’s sp_ineachdb. Has anyone got this to work? Kindly advise on how to do it please.

Thank you