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.186
Language: C# Updated: 2026-11-04
Command

New-DotNetPublishConfig

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>]
#
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

New-DotNetPublishConfig -ProjectRoot '.' -PassThru

Generate config for a selected project and overwrite existing file

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.