03-powershell-module/ModuleName/ModuleName.psm1
#region SourceInit $publicFunctions = @() foreach ($ScriptPathItem in 'Private','Public') { $ScriptSearchFilter = [io.path]::Combine($PSScriptRoot, $ScriptPathItem, '*.ps1') Get-ChildItem $ScriptSearchFilter | Foreach-Object { if ($ScriptPathItem -eq 'Public') {$PublicFunctions += $PSItem.BaseName} . $PSItem } } #endregion SourceInit |