JBONWS.psm1

<#
    File: JBONWS.psm1
    Author: Casper Stekelenburg
    Publisher: Casper Stekelenburg
    Copyright: © 2019 Casper Stekelenburg. All rights reserved.
    Usage: To load this module in PowerShell: Import-Module -Name JBONWS
    Notes: The software is provided "as is", without warranty of any kind, express or implied, including
                but not limited to the warranties of merchantability, fitness for a particular purpose and
                noninfringement. In no event shall the authors or copyright holders be liable for any claim,
                damages or other liability, whether in an action of contract, tort or otherwise, arising from,
                out of or in connection with the software or the use or other dealings in the software.
#>

#Set-StrictMode -Version 2

# Functions in this module:
#Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )

#Dot source the files
Foreach ($import in @($Public + $Private)) {
    Try {
        . $import.fullname
    } Catch {
        Write-Error -Message "Failed to import function $($import.fullname): $_"
    }
}

# Here I might...
# Read in or create an initial config file and variable
# Export Public functions ($Public.BaseName) for WIP modules
# Set variables visible to the module and its functions only

Export-ModuleMember -Function $Public.Basename -Alias * -Variable * -Cmdlet *