Create PowerShell functions and modules the right way. Listed guides/recommendations in this living document based on skill level and step in process.
D365 LBD Unable to cleanup modules. Manual fix with D365FOLBDAdmin module.
D365LBD initializationexception database login failed please check SQL credentials:
Using the Get-D365LBDConfig function will help you automate your Dynamics 365 environments and not need to hardcode environment details in your pre or post deployment scripts.