gaelcolas / Sampler

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

"Right" location for an external DLL #431

Closed cohdjn closed 10 months ago

cohdjn commented 1 year ago

I'm writing a custom PowerShell module and I need to distribute a DLL with the code. What is the "right" directory to put the DLL in using the SimpleModule scaffold?

gaelcolas commented 1 year ago

I'd create a subfolder called lib/. If you add the dll in git, add source/lib Basically, I'd avoid using a "reserved name" of stuff that is merged together by ModuleBuilder: https://github.com/PoshCode/ModuleBuilder/blob/main/Source/Public/Build-Module.ps1#L99

So avoid Enum, Classes, Public, Private. Should also avoid help, docs, en.... but that's more obvious anyway.

johlju commented 1 year ago

@cohdjn I'm curious how you build the module once you imported the built module it into the session. Are you always debugging/testing the module in a separate process so you can built the module again so it can replace the .dll without throwing that there is a locked file?

I'm tagging this and documentation so someone can update the README.md (docs) for this.