# Invoke-DotNetReleaseBuild

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

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`

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

[#](#method-invoke-dotnetreleasebuild-string-certificatestorelocation-switchparameter-switchparameter-switchparameter-string-string)

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.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Run a PowerForge.Web quality pipeline](/projects/pspublishmodule/examples/run-powerforge-web-quality-pipeline/) Example
  
  A website quality-gate example that connects build commands with verify and audit expectations.

## Examples

### Build and pack a project (and its dependency projects)

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

### Build and sign a project (certificate thumbprint)

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

### Preview the release build plan (no build)

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

### Build multiple projects in one invocation

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

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:500035039F9497287D7DAA578B073DA561A5A467BA82E092B872A5A2BDDF0759 -->
