# New-DotNetPublishConfig

Scaffolds a starter powerforge.dotnetpublish.json configuration file.

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

`System.String` `PowerForge.DotNetPublishConfigScaffoldResult`

Scaffolds a starter powerforge.dotnetpublish.json configuration file.

## Syntax

```
New-DotNetPublishConfig
[-Configuration <String>]
[-Force]
[-Framework <String>]
[-NoSchema]
[-OutputPath <String>]
[-PassThru]
[-ProjectPath <String>]
[-ProjectRoot <String>]
[-Runtimes <String[]>]
[-Styles <DotNetPublishStyle[]>]
[-TargetName <String>]
[<CommonParameters>]
```

[#](#method-new-dotnetpublishconfig-string-switchparameter-string-switchparameter-string-switchparameter-string-string-string-dotnetpublishstyle-string)

Parameter set: `All Parameter Sets`

## Description

Use this cmdlet for JSON-first onboarding of the DotNet publish engine. The generated config can be executed with Invoke-DotNetPublish -ConfigPath ....

## Examples

### Create a starter config from the current repository root

```powershell
New-DotNetPublishConfig -ProjectRoot '.' -PassThru
```

### Generate config for a selected project and overwrite existing file

```powershell
New-DotNetPublishConfig -Project '.\src\App\App.csproj' -Runtimes 'win-x64','win-arm64' -Styles PortableCompat,AotSpeed -Force
```

## Parameters

**-Configuration String optional**

Build configuration (default: Release).

**-Force SwitchParameter optionalaliases: Overwrite**

Overwrite existing config file.

**-Framework String optional**

Optional framework override (for example net10.0).

**-NoSchema SwitchParameter optional**

Omits the $schema property from generated JSON.

**-OutputPath String optionalaliases: ConfigPath, Path**

Output config path (default: powerforge.dotnetpublish.json).

**-PassThru SwitchParameter optional**

Returns detailed scaffold metadata instead of only config path.

**-ProjectPath String optionalaliases: Project**

Optional path to a specific project file. When omitted, the first matching .csproj is used.

**-ProjectRoot String optional**

Project root used to resolve relative paths.

**-Runtimes String[] optional**

Optional runtime identifiers override.

**-Styles DotNetPublishStyle[] optional**

Optional publish styles override.

Possible values: `Portable`, `PortableCompat`, `PortableSize`, `SelfContained`, `FrameworkDependent`, `AotSpeed`, `AotSize`

**-TargetName String optional**

Optional target name override. Defaults to project file name.

## 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:48112BD31E356B91C3EAE01748AFE12CF4A1F8356FBBC0BF74C02B8859F3D78B -->
