gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
171 stars 42 forks source link

Module (having classes and functions) built with sampler. Importing module, classes not visible. #499

Closed KarstenHabay closed 1 week ago

KarstenHabay commented 1 week ago

Hi,

I'm building my modules with sampler. They contain mostly classes and functions.

I got 2 major issues with my classes:

Am I missing something? I couldn't find much info on using classes in the sampler help. Functions are exported through the Manifest. I was unable to find anything on classes. They are copied into my .psm1 file.

Any help would be greatly appreciated.

Greets, Karsten

KarstenHabay commented 1 week ago

[SOLVED]

I just had to add using module MyModuleName on top of the file. 🙄

johlju commented 1 week ago

Great that you found it, it is normally added to prefix.ps1 and update build configuration to recognize that file.