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

New-ConfigurationDotNetTarget

Module PSPublishModule
Inputs
None
Outputs
PowerForge.DotNetPublishTarget

Creates a DotNet publish target entry for DotNet publish DSL.

Syntax

New-ConfigurationDotNetTarget [-ClearOutput <Boolean>] [-ExecutableIdentity <String>] -Framework <String> [-Frameworks <String[]>] [-KeepDocs] [-KeepSymbols] [-Kind <Unknown|Cli|Desktop|Service|Library>] -Name <String> [-OutputPath <String>] [-ProjectId <String>] [-ProjectPath <String>] [-PruneReferences <Boolean>] [-ReadyToRun <Boolean>] [-RenameTo <String>] [-Runtimes <String[]>] [-Service <DotNetPublishServicePackageOptions>] [-Sign <DotNetPublishSignOptions>] [-Slim <Boolean>] [-State <DotNetPublishStatePreservationOptions>] [-Style <DotNetPublishStyle>] [-Styles <DotNetPublishStyle[]>] [-SupportedRuntimes <String[]>] [-UseStaging <Boolean>] [-Zip] [-ZipNameTemplate <String>] [-ZipPath <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Create a service target with matrix runtimes

New-ConfigurationDotNetTarget -Name 'My.Service' -ProjectPath 'src/My.Service/My.Service.csproj' -Framework 'net10.0-windows' -Runtimes 'win-x64','win-arm64' -Style PortableCompat -Zip

Parameters

-ClearOutput Boolean optional
Clear final output before copy.
-ExecutableIdentity String optional
Optional expected signed product or assembly identity for the primary executable.
-Framework String required
Target framework (for example net10.0 or net10.0-windows).
-Frameworks String[] optional
Optional framework matrix values.
-KeepDocs SwitchParameter optional
Keep documentation files (*.xml, *.pdf).
-KeepSymbols SwitchParameter optional
Keep symbol files (*.pdb).
-Kind DotNetPublishTargetKind optional
Target kind metadata.
Possible values: Unknown, Cli, Desktop, Service, Library
-Name String required
Friendly target name.
-OutputPath String optional
Optional output path template.
-ProjectId String optional
Optional project catalog identifier.
-ProjectPath String optional
Path to target project file (*.csproj).
-PruneReferences Boolean optional
Prune ref/ folder from output.
-ReadyToRun Boolean optional
Optional ReadyToRun toggle for non-AOT styles.
-RenameTo String optional
Optional executable rename applied after publish.
-Runtimes String[] optional
Runtime identifiers.
-Service DotNetPublishServicePackageOptions optional
Optional service packaging settings for this target.
-Sign DotNetPublishSignOptions optional
Optional signing policy for this target.
-Slim Boolean optional
Apply slimming cleanup.
-State DotNetPublishStatePreservationOptions optional
Optional preserve/restore settings for rebuild-safe deployments.
-Style DotNetPublishStyle optional
Primary publish style.
Possible values: Portable, PortableCompat, PortableSize, SelfContained, FrameworkDependent, AotSpeed, AotSize
-Styles DotNetPublishStyle[] optional
Optional style matrix values.
Possible values: Portable, PortableCompat, PortableSize, SelfContained, FrameworkDependent, AotSpeed, AotSize
-SupportedRuntimes String[] optional
Supported runtime identifiers. Used as the default target matrix and checked after runtime overrides.
-UseStaging Boolean optional
Use staging directory before final copy.
-Zip SwitchParameter optional
Create zip artifact for target output.
-ZipNameTemplate String optional
Optional zip file name template.
-ZipPath String optional
Optional explicit zip output path.

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.