TSMarkdown.psm1
#region 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 ) #endregion #region source the files foreach ($Function in @($Public + $Private)) { $FunctionPath = $Function.fullname try { . $FunctionPath # dot source function } catch { Write-Error -Message "Failed to import function at $(FunctionPath): $_" } } #endregion #region read in or create an initial config file and variable #endregion #region set variables visible to the module and its functions only $Date = Get-Date -UFormat "%Y.%m.%d" $Time = Get-Date -UFormat "%H:%M:%S" $Green = @{ Background = 'Black' Foreground = 'Green' } $Cyan = @{ Background = 'Black' Foreground = 'Cyan' } $Magenta = @{ Background = 'Black' Foreground = 'Magenta' } #endregion #region export Public functions ($Public.BaseName) for WIP modules Export-ModuleMember -Function $Public.Basename #endregion |