functions/Publish-ModuleToFeed.ps1

function Publish-ModuleToFeed {
    Param(
        [Parameter(Mandatory = $true)]
        [string]
        $NugetAPIKey,
        [Parameter(Mandatory = $true)]
        [string]
        $RepositoryName,
        [Parameter(Mandatory = $true)]
        [string]
        $ModuleFolderPath
    )
    begin {
    }
    process {
        $PublishParams = @{
            NuGetApiKey = $NugetAPIKey
            Path        = $ModuleFolderPath
            Repository  = $RepositoryName
        }
    }
    end {
        Publish-Module @PublishParams -Force -Verbose
    }
}