Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Invoke-DotNetPublish

Namespace PSPublishModule
Inputs
None
Outputs
PowerForge.DotNetPublishPlan PowerForge.DotNetPublishResult

Executes DotNet publish engine from DSL settings or an existing JSON config.

Remarks

This cmdlet follows the same authoring pattern as module build cmdlets: create a config using New-ConfigurationDotNet* and run it directly, or export config first via -JsonOnly + -JsonPath.

Examples

Authored help example

Generate DotNet publish JSON from DSL without execution


Invoke-DotNetPublish -JsonOnly -JsonPath '.\powerforge.dotnetpublish.json' -Settings {
    New-ConfigurationDotNetPublish -IncludeSchema -ProjectRoot '.' -Configuration 'Release'
    New-ConfigurationDotNetTarget -Name 'PowerForge.Cli' -ProjectPath 'PowerForge.Cli/PowerForge.Cli.csproj' -Framework 'net10.0' -Runtimes 'win-x64' -Style PortableCompat -Zip
}
        

Run DotNet publish from existing JSON config


Invoke-DotNetPublish -ConfigPath '.\powerforge.dotnetpublish.json' -ExitCode
        

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.

Syntax

Invoke-DotNetPublish [-ExitCode] [-Frameworks <String[]>] [-JsonOnly] [-JsonPath <String>] [-NoInteractive] [-Plan] [-Profile <String>] [-Runtimes <String[]>] -Settings <ScriptBlock> [-SkipBuild] [-SkipRestore] [-Styles <Portable>] [-Target <String[]>] [-Validate] [<CommonParameters>]
#
Parameter set: Settings

Parameters

ExitCode SwitchParameter optionalposition: namedpipeline: False
Sets host exit code: 0 on success, 1 on failure.
Frameworks String[] optionalposition: namedpipeline: Falsealiases: Framework
Optional framework override for selected targets.
JsonOnly SwitchParameter optionalposition: namedpipeline: False
Exports JSON config and exits without running the engine.
JsonPath String optionalposition: namedpipeline: False
Output path for JSON config used with JsonOnly.
NoInteractive SwitchParameter optionalposition: namedpipeline: False
Disables interactive output mode. Reserved for future UI parity.
Plan SwitchParameter optionalposition: namedpipeline: False
Builds and emits resolved plan without executing steps.
Profile String optionalposition: namedpipeline: False
Optional profile override.
Runtimes String[] optionalposition: namedpipeline: Falsealiases: Rid, Runtime
Optional runtime override for selected targets.
Settings ScriptBlock requiredposition: namedpipeline: False
DSL settings block that emits DotNet publish objects.
SkipBuild SwitchParameter optionalposition: namedpipeline: False
Disables build steps for this run.
SkipRestore SwitchParameter optionalposition: namedpipeline: False
Disables restore steps for this run.
Styles DotNetPublishStyle[] optionalposition: namedpipeline: Falsealiases: Stylevalues: 6
Optional style override for selected targets.
Possible values: Portable, PortableCompat, PortableSize, FrameworkDependent, AotSpeed, AotSize
Target String[] optionalposition: namedpipeline: Falsealiases: Targets
Optional target-name filter override.
Validate SwitchParameter optionalposition: namedpipeline: False
Validates configuration by planning only; does not execute run steps.

Outputs

PowerForge.DotNetPublishPlan PowerForge.DotNetPublishResult

Invoke-DotNetPublish -ConfigPath <String> [-ExitCode] [-Frameworks <String[]>] [-JsonOnly] [-JsonPath <String>] [-NoInteractive] [-Plan] [-Profile <String>] [-Runtimes <String[]>] [-SkipBuild] [-SkipRestore] [-Styles <Portable>] [-Target <String[]>] [-Validate] [<CommonParameters>]
#
Parameter set: Config

Parameters

ConfigPath String requiredposition: namedpipeline: False
Path to existing DotNet publish JSON config.
ExitCode SwitchParameter optionalposition: namedpipeline: False
Sets host exit code: 0 on success, 1 on failure.
Frameworks String[] optionalposition: namedpipeline: Falsealiases: Framework
Optional framework override for selected targets.
JsonOnly SwitchParameter optionalposition: namedpipeline: False
Exports JSON config and exits without running the engine.
JsonPath String optionalposition: namedpipeline: False
Output path for JSON config used with JsonOnly.
NoInteractive SwitchParameter optionalposition: namedpipeline: False
Disables interactive output mode. Reserved for future UI parity.
Plan SwitchParameter optionalposition: namedpipeline: False
Builds and emits resolved plan without executing steps.
Profile String optionalposition: namedpipeline: False
Optional profile override.
Runtimes String[] optionalposition: namedpipeline: Falsealiases: Rid, Runtime
Optional runtime override for selected targets.
SkipBuild SwitchParameter optionalposition: namedpipeline: False
Disables build steps for this run.
SkipRestore SwitchParameter optionalposition: namedpipeline: False
Disables restore steps for this run.
Styles DotNetPublishStyle[] optionalposition: namedpipeline: Falsealiases: Stylevalues: 6
Optional style override for selected targets.
Possible values: Portable, PortableCompat, PortableSize, FrameworkDependent, AotSpeed, AotSize
Target String[] optionalposition: namedpipeline: Falsealiases: Targets
Optional target-name filter override.
Validate SwitchParameter optionalposition: namedpipeline: False
Validates configuration by planning only; does not execute run steps.

Outputs

PowerForge.DotNetPublishPlan PowerForge.DotNetPublishResult