Sometimes developer of PowerShell module creates a function that he then uses that function across his module but hides it, so it's not accessible when someone installs and imports it. I have created several PowerShell modules that have Public one or two commands and then Private, non-accessible functions that I didn't want to expose. But what if you wanted to use some of those functions? What if the function was so good that you wanted to use it in your code without “extracting” that function from someone else's code (which may or may not be as simple as copy/paste). Fortunately, there is a way to do it:
As you can see my PSWinDocumentation.AD PowerShell module has only two exported functions. That was intentional and something I've done on purpose. However, that module has about 100 small, internal, private functions that I use to deliver results. If for some reason you would like to use any of those functions in your code you can either copy/paste it from my GitHub repository into your own and use the function to suit your needs or call it like that.
Notice that again I'm using Import-Module, but the magic here is about PassThru switch. You can utilize any of the private functions that way. In my case, I'm calling Get-WinADDomain. Notice that I'm using & (ampersand) – & is the call operator which allows you to execute a command, a script, or a function.
So instead of copying some functions from other modules, you can use that instead.