# Publish-GitHubReleaseAsset

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

Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`None`

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

## 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>]
```

[#](#method-publish-githubreleaseasset-switchparameter-string-string-string-switchparameter-switchparameter-string-string-string-string-string-string)

Parameter set: `All Parameter Sets`

## Description

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

### Create a release and upload the default ZIP asset

```powershell
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

```powershell
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.

## Parameters

**-GenerateReleaseNotes SwitchParameter optional**

When set, asks GitHub to generate release notes automatically.

**-GitHubAccessToken String required**

Personal access token used for authentication.

**-GitHubRepositoryName String required**

Name of the GitHub repository.

**-GitHubUsername String required**

GitHub account name owning the repository.

**-IncludeProjectNameInTag SwitchParameter optional**

When set, generates tag name as <Project>-v<Version>.

**-IsPreRelease SwitchParameter optional**

Publish the release as a pre-release.

**-ProjectPath String[] required**

Path to the project folder containing the *.csproj file.

**-ReleaseName String optional**

Optional release name override (defaults to TagName).

**-TagName String optional**

Optional tag name override.

**-TagTemplate String optional**

Optional tag template (supports {Project} and {Version}).

**-Version String optional**

Optional version override (otherwise read from VersionPrefix).

**-ZipPath String optional**

Optional zip path override (defaults to bin/Release/<Project>.<Version>.zip).

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7E131AD975C67643019469B63A9FD663FFF53759D08B431D7797DC9765E5315D -->
