Closed jangins101 closed 8 years ago
It's an interesting idea, but it would kind of defeat the point of having a module, if we're then having to keep up with 20+ individual function files. Is the concern that the module file is too monolithic and difficult to work with? Thanks.
Yea. I've been working on a module for some stuff I'm doing at work, and found that having the psm1
file import all ps1
files in the module directory made it easy to insert new methods into the module, and finding a method quickly is doable. That way, you still get the benefit of having a portable module while maintaining each method individually.
I figure another thing would be if someone wanted to add a method, they could just add a new file and submit a merge request back into the master.
Hi. Sorry for the delay getting back to you. It might be something I want to do in the future, so I'll leave this issue open for now. Thanks.
+1 vote for splitting
Commit c3aedc650296172b8ed3d019b8da6bd604b4240c provides a preview of splitting functions into individual .ps1 files.
Thanks. Let me chew on this for a little bit and review what you've committed.
I like this and I want to move forward with it. I'm wondering, though, about the \Public and \Private groupings. Is the thinking that scripts/functions in the Public group would be made exportable and ones in the Private group would be hidden?
Yes, exactly. Private functions are internal, not exported. I observed this in @proxb's PoshRSJob repo and intend to adopt it for other projects.
Do you think it would be useful to split each of the methods into individual files containing the functions? That way, new files could be added to the project and the
.psm1
file could just dot source all the.ps1
files (maybe in a subfolder too).