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

Module PSPublishModule
Inputs
None

Helps define custom placeholders replacing content within a script or module during the build process.

Syntax

New-ConfigurationPlaceHolder -Find <String> -Replace <String> [<CommonParameters>]
#
Parameter set: FindAndReplace
New-ConfigurationPlaceHolder -CustomReplacement <PlaceHolderReplacement[]> [<CommonParameters>]
#
Parameter set: CustomReplacement

Description

Placeholders are applied during merge/packaging so you can inject build-time values (versions, build IDs, timestamps) without hardcoding them into source files.

Examples

Authored help example

Replace a single placeholder token

New-ConfigurationPlaceHolder -Find '{{ModuleVersion}}' -Replace '1.2.3'

Replaces all occurrences of {{ModuleVersion}} in merged content.

Provide multiple replacements

New-ConfigurationPlaceHolder -CustomReplacement @{ Find='{{Company}}'; Replace='Evotec' }, @{ Find='{{Year}}'; Replace='2025' }

Emits multiple placeholder replacement segments in one call.

Parameters

-Find String requiredsets: FindAndReplace
The string to find in the script or module content.
-Replace String requiredsets: FindAndReplace
The string to replace the Find string in the script or module content.
-CustomReplacement PlaceHolderReplacement[] requiredsets: CustomReplacement
Custom placeholder replacements. Accepts legacy hashtable array (@{ Find='..'; Replace='..' }) or PlaceHolderReplacement[].

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.