Project

PSPublishModule

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

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-17
Command

Invoke-DotNetReleaseBuild

Module PSPublishModule
Inputs
None
Outputs
PowerForge.DotNetReleaseBuildResult

Builds a .NET project in Release configuration and prepares release artefacts.

Syntax

Invoke-DotNetReleaseBuild [-CertificateThumbprint <String>] [-LocalStore <CurrentUser|LocalMachine>] [-OverwriteSignedAssemblies] [-OverwriteSignedPackages] [-PackDependencies] -ProjectPath <String[]> [-TimeStampServer <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

The cmdlet discovers the .csproj file (when a directory is provided), reads VersionPrefix from the project, then runs dotnet build and dotnet pack in Release (by default). It produces a ZIP snapshot of the release output and returns a typed result object for each input project path.

Use -WhatIf to preview the planned outputs without running build/pack/sign operations.

Examples

Authored help example

Build and pack a project (and its dependency projects)

Invoke-DotNetReleaseBuild -ProjectPath '.\MyLibrary\MyLibrary.csproj' -PackDependencies

Build and sign a project (certificate thumbprint)

Invoke-DotNetReleaseBuild -ProjectPath '.\MyLibrary\MyLibrary.csproj' -CertificateThumbprint '0123456789ABCDEF' -LocalStore CurrentUser

Preview the release build plan (no build)

Invoke-DotNetReleaseBuild -ProjectPath '.\MyLibrary' -PackDependencies -WhatIf

Build multiple projects in one invocation

Invoke-DotNetReleaseBuild -ProjectPath '.\ProjectA\ProjectA.csproj', '.\ProjectB\ProjectB.csproj' -PackDependencies

Parameters

-CertificateThumbprint String optional
Optional certificate thumbprint used to sign assemblies and packages. When omitted, no signing is performed.
-LocalStore CertificateStoreLocation optional
Certificate store location used when searching for the signing certificate. Default: CurrentUser.
Possible values: CurrentUser, LocalMachine
-OverwriteSignedAssemblies SwitchParameter optional
Explicitly replaces existing Authenticode assembly signatures.
-OverwriteSignedPackages SwitchParameter optional
Explicitly replaces existing NuGet package signatures.
-PackDependencies SwitchParameter optional
When enabled, also packs all project dependencies that have their own .csproj files.
-ProjectPath String[] required
Path to the folder containing the project (*.csproj) file (or the csproj file itself).
-TimeStampServer String optional
Timestamp server URL used while signing. Default: http://timestamp.digicert.com.

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.