functions/Add-FunctionsToExport.ps1

<#
.SYNOPSIS
Add-FunctionsToExport Gets all functions from functions folder and exports
 
.DESCRIPTION
Gets all functions from functions folder and exports.
 
.PARAMETER ManifestFilePath
This is the location of the psd1 manifest file in your project NB full path needed
 
.EXAMPLE
Add-FunctionsToExport -ManifestFilePath C:\ToolModule\ToolModule.psd1
 
.NOTES
General notes
#>

function Add-FunctionsToExport {
    [CmdletBinding()]
    param(
        [parameter(Mandatory = $true)][string]$ManifestFilePath
    )

    begin {}
    process {
        $wip = $ManifestFilePath | Split-Path

        if (Test-Path("$wip\functions")) {
            $FunctionToExport += Get-ChildItem "$wip\functions" | Select-Object -expand BaseName
        }

        Update-ModuleManifest -Path $ManifestFilePath -FunctionsToExport $FunctionToExport
    }
    end {}
}