I was wondering what the preferred method of hiding helper functions in a module. My module is applying a set of ACL permissions across 2 levels of a folder template with the second (helper) being called to handle the subfolders. I don’t want people to see the second function because it’s not meant to be called on it’s own.
I’ve seen a few suggestions on how to accomplish this.
Give the helper function a non verb-noun name (or at least an invalid verb name) which would cause the function to be hidden from a normal call of import-module.
Use Export-ModuleMember at the bottom of the module for each function i do want to export.
Build a module manifest to list the functions i want to export.
I’m leaning towards 3 because it’s the one i heard about through CBT Nuggets but also because it seems to be the “right” way to do it and has more options to add for the module.
What is the best practice?
Also as i am not exposing the function do i need to worry about adding comment based help? You won’t be able to view it without opening up the module.