'How to require a dll inside .psd1 for a .psm1 that is being invoked from a .ps1?

I read a lot of the answers here and I can't seem to find what I am looking for. So please bear with me.

Each psm1 is a class.

I have:

Main.ps1

Modules/module01.psm1

Modules/module02.psm1

DLL/dllInQuestion.dll

I am trying to load a dll to use inside module02.psm1. I know that in order to do so I have to require it inside a .psd1. I created a psd1 for module02 and put it in the same folder and imported it like this "Import-Module" before the code but it didn't work.

I also tried to create a psd1 for Main.ps1 but it didn't work.

Can I require (using using module statements and Add-Type) all modules and dll inside a .ps1 script and require it inside a .psd1 for Main.ps1?

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source