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

Send-GitHubRelease

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

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

Remarks

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

Authored help example

Create a release and upload a ZIP asset

PS>


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

PS>


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.

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

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>]
#
Parameter set: All Parameter Sets

Parameters

AssetFilePaths String[] optionalposition: namedpipeline: False
The full paths of the files to include as release assets.
Commitish String optionalposition: namedpipeline: False
Commitish value that determines where the Git tag is created from.
GenerateReleaseNotes SwitchParameter optionalposition: namedpipeline: False
When set, asks GitHub to generate release notes automatically (cannot be used with ReleaseNotes).
GitHubAccessToken String requiredposition: namedpipeline: False
GitHub personal access token used for authentication.
GitHubRepositoryName String requiredposition: namedpipeline: False
GitHub repository name.
GitHubUsername String requiredposition: namedpipeline: False
GitHub username owning the repository.
IsDraft Boolean optionalposition: namedpipeline: False
True to create a draft (unpublished) release.
IsPreRelease Boolean optionalposition: namedpipeline: False
True to identify the release as a prerelease.
ReleaseName String optionalposition: namedpipeline: False
The name of the release. If omitted, TagName is used.
ReleaseNotes String optionalposition: namedpipeline: False
The text describing the contents of the release.
ReuseExistingReleaseOnConflict Boolean optionalposition: namedpipeline: False
When true (default), a 422 tag conflict reuses the existing release. When false, the cmdlet fails on existing tags.
TagName String requiredposition: namedpipeline: False
The tag name used for the release.

Outputs

System.Object