Command
New-DotNetPublishConfig
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 SetsDescription
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 '.' -PassThruGenerate config for a selected project and overwrite existing file
New-DotNetPublishConfig -Project '.\src\App\App.csproj' -Runtimes 'win-x64','win-arm64' -Styles PortableCompat,AotSpeed -ForceParameters
- -Configuration String
- Build configuration (default: Release).
- -Force SwitchParameter
- Overwrite existing config file.
- -Framework String
- Optional framework override (for example net10.0).
- -NoSchema SwitchParameter
- Omits the $schema property from generated JSON.
- -OutputPath String
- Output config path (default: powerforge.dotnetpublish.json).
- -PassThru SwitchParameter
- Returns detailed scaffold metadata instead of only config path.
- -ProjectPath String
- Optional path to a specific project file. When omitted, the first matching .csproj is used.
- -ProjectRoot String
- Project root used to resolve relative paths.
- -Runtimes String[]
- Optional runtime identifiers override.
- -Styles DotNetPublishStyle[]
- Optional publish styles override.
- Possible values:
Portable,PortableCompat,PortableSize,SelfContained,FrameworkDependent,AotSpeed,AotSize - -TargetName String
- 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.