Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Publish-GitHubReleaseAsset

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

Publishes a release asset to GitHub (creates a release and uploads a zip).

Remarks

Reads project metadata from *.csproj, resolves the release version (unless overridden), creates a GitHub release, and uploads the specified ZIP asset. For private repositories, use a token with the minimal required scope and prefer providing it via an environment variable.

Examples

Authored help example

Create a release and upload the default ZIP asset

PS>


Publish-GitHubReleaseAsset -ProjectPath '.\MyProject\MyProject.csproj' -GitHubUsername 'EvotecIT' -GitHubRepositoryName 'MyProject' -GitHubAccessToken $env:GITHUB_TOKEN
        

Creates a GitHub release and uploads bin\Release\<Project>.<Version>.zip.

Publish a pre-release with a custom tag template

PS>


Publish-GitHubReleaseAsset -ProjectPath '.\MyProject\MyProject.csproj' -GitHubUsername 'EvotecIT' -GitHubRepositoryName 'MyProject' -GitHubAccessToken $env:GITHUB_TOKEN -IsPreRelease -TagTemplate '{Project}-v{Version}'
        

Useful when your repository uses a specific tag naming convention.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Publish-GitHubReleaseAsset [-GenerateReleaseNotes] -GitHubAccessToken <String> -GitHubRepositoryName <String> -GitHubUsername <String> [-IncludeProjectNameInTag] [-IsPreRelease] -ProjectPath <String[]> [-ReleaseName <String>] [-TagName <String>] [-TagTemplate <String>] [-Version <String>] [-ZipPath <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

GenerateReleaseNotes SwitchParameter optionalposition: namedpipeline: False
When set, asks GitHub to generate release notes automatically.
GitHubAccessToken String requiredposition: namedpipeline: False
Personal access token used for authentication.
GitHubRepositoryName String requiredposition: namedpipeline: False
Name of the GitHub repository.
GitHubUsername String requiredposition: namedpipeline: False
GitHub account name owning the repository.
IncludeProjectNameInTag SwitchParameter optionalposition: namedpipeline: False
When set, generates tag name as <Project>-v<Version>.
IsPreRelease SwitchParameter optionalposition: namedpipeline: False
Publish the release as a pre-release.
ProjectPath String[] requiredposition: namedpipeline: False
Path to the project folder containing the *.csproj file.
ReleaseName String optionalposition: namedpipeline: False
Optional release name override (defaults to TagName).
TagName String optionalposition: namedpipeline: False
Optional tag name override.
TagTemplate String optionalposition: namedpipeline: False
Optional tag template (supports {Project} and {Version}).
Version String optionalposition: namedpipeline: False
Optional version override (otherwise read from VersionPrefix).
ZipPath String optionalposition: namedpipeline: False
Optional zip path override (defaults to bin/Release/<Project>.<Version>.zip).

Outputs

System.Object