# Send-GitHubRelease

Creates a new release for the given GitHub repository and optionally uploads assets.

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`

Creates a new release for the given GitHub repository and optionally uploads assets.

## Syntax

```
Send-GitHubRelease
[-AssetFilePaths <String[]>]
[-Commitish <String>]
[-GenerateReleaseNotes]
-GitHubAccessToken <String>
-GitHubRepositoryName <String>
-GitHubUsername <String>
[-IsDraft <Boolean>]
[-IsPreRelease <Boolean>]
[-ReleaseName <String>]
[-ReleaseNotes <String>]
[-ReuseExistingReleaseOnConflict <Boolean>]
-TagName <String>
[<CommonParameters>]
```

[#](#method-send-githubrelease-string-string-switchparameter-string-string-string-boolean-boolean-string-string-boolean-string)

Parameter set: `All Parameter Sets`

## Description

This cmdlet uses the GitHub REST API to create a release and upload assets. It is a lower-level building block used by higher-level helpers (such as Publish-GitHubReleaseAsset) and can also be used directly in CI pipelines.

Provide the token via an environment variable to avoid leaking secrets into logs or history.

## Examples

### Create a release and upload a ZIP asset

```powershell
Send-GitHubRelease -GitHubUsername 'EvotecIT' -GitHubRepositoryName 'MyProject' -GitHubAccessToken $env:GITHUB_TOKEN -TagName 'v1.2.3' -ReleaseNotes 'Bug fixes' -AssetFilePaths 'C:\Artifacts\MyProject.zip'
```

Creates the release and uploads the specified asset file.

### Create a prerelease as a draft

```powershell
Send-GitHubRelease -GitHubUsername 'EvotecIT' -GitHubRepositoryName 'MyProject' -GitHubAccessToken $env:GITHUB_TOKEN -TagName 'v1.2.3-preview.1' -IsDraft $true -IsPreRelease $true
```

Creates a draft prerelease that can be reviewed before publishing.

## Parameters

**-AssetFilePaths String[] optional**

The full paths of the files to include as release assets.

**-Commitish String optional**

Commitish value that determines where the Git tag is created from.

**-GenerateReleaseNotes SwitchParameter optional**

When set, asks GitHub to generate release notes automatically (cannot be used with ReleaseNotes).

**-GitHubAccessToken String required**

GitHub personal access token used for authentication.

**-GitHubRepositoryName String required**

GitHub repository name.

**-GitHubUsername String required**

GitHub username owning the repository.

**-IsDraft Boolean optional**

True to create a draft (unpublished) release.

**-IsPreRelease Boolean optional**

True to identify the release as a prerelease.

**-ReleaseName String optional**

The name of the release. If omitted, TagName is used.

**-ReleaseNotes String optional**

The text describing the contents of the release.

**-ReuseExistingReleaseOnConflict Boolean optional**

When true, a 422 tag conflict deliberately reuses the existing release. The default is false so normal publishing cannot mutate an older release.

**-TagName String required**

The tag name used for the release.

## 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:3B345A1C4D7D070E8578FC4C21ECE23222B78FE65D9D81FB9AE7A1CE349F077C -->
