Catesta icon indicating copy to clipboard operation
Catesta copied to clipboard

Add functionality for automating the substitution of public functions into the manifest

Open techthoughts2 opened this issue 1 year ago • 2 comments

It has been suggested in both #69 and #97 that Catesta should automate the process of populating public functions into the .psd1 manifest.

One proposed solution is to add a build task for this:

#Updates the array for FunctionsToExport in the module manifest
Add-BuildTask UpdateFunctionsToExport -Before TestModuleManifest {
    Write-Build White '      Running module manifest update FuctionsToExport...'
    $publicFunctionPath = Join-Path -Path $script:ModuleSourcePath -ChildPath 'Public'
    $publicFunctions = Get-ChildItem -Path $publicFunctionPath -Filter '*.ps1' -Recurse
    Update-ModuleManifest -Path $script:ModuleManifestFile -FunctionsToExport $publicFunctions.BaseName
    Write-Build Green '      ...Module Manifest Update FunctionsToExport Complete!'
} #UpdateFunctionsToExport

I'd like some community feedback on this change. Are there situations where this would not be desirable?

techthoughts2 avatar Oct 05 '24 18:10 techthoughts2