Skip to content

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

Description

@techthoughts2

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionCommunity input on issuedesiredenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions