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

New-ConfigurationFileConsistency

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

Creates configuration for file consistency checking (encoding and line endings) during module build.

Remarks

Adds a file-consistency validation step to the pipeline. This can enforce required encoding/line-ending rules and (optionally) auto-fix issues during a build.

Examples

Authored help example

Enforce UTF-8 BOM + CRLF and auto-fix during build

PS>


New-ConfigurationFileConsistency -Enable -FailOnInconsistency -RequiredEncoding UTF8BOM -RequiredLineEnding CRLF -AutoFix -CreateBackups -ExportReport
        

Enforces consistency and exports a CSV report; backups are created before fixes are applied.

Audit project root consistency (no fixes)

PS>


New-ConfigurationFileConsistency -Enable -RequiredEncoding UTF8BOM -RequiredLineEnding CRLF -ExportReport -Scope StagingAndProject
        

Runs validation on staging and project root, exports a report, and does not apply automatic fixes.

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

New-ConfigurationFileConsistency [-AutoFix] [-CheckMissingFinalNewline] [-CheckMixedLineEndings] [-CreateBackups] [-Enable] [-EncodingOverrides <Hashtable>] [-ExcludeDirectories <String[]>] [-ExcludeFiles <String[]>] [-ExportReport] [-FailOnInconsistency] [-IncludePatterns <String[]>] [-LineEndingOverrides <Hashtable>] [-MaxInconsistencyPercentage <Int32>] [-ProjectKind <Nullable`1>] [-ReportFileName <String>] [-RequiredEncoding <ASCII>] [-RequiredLineEnding <CRLF|LF>] [-Scope <StagingOnly|ProjectOnly|StagingAndProject>] [-Severity <Nullable`1>] [-UpdateProjectRoot] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AutoFix SwitchParameter optionalposition: namedpipeline: False
Automatically fix encoding and line ending issues during build.
CheckMissingFinalNewline SwitchParameter optionalposition: namedpipeline: False
Check for files missing final newlines.
CheckMixedLineEndings SwitchParameter optionalposition: namedpipeline: False
Check for files with mixed line endings.
CreateBackups SwitchParameter optionalposition: namedpipeline: False
Create backup files before applying automatic fixes.
Enable SwitchParameter optionalposition: namedpipeline: False
Enable file consistency checking during build.
EncodingOverrides Hashtable optionalposition: namedpipeline: False
Per-path encoding overrides (patterns mapped to encodings).
ExcludeDirectories String[] optionalposition: namedpipeline: False
Directory names to exclude from consistency analysis.
ExcludeFiles String[] optionalposition: namedpipeline: False
File patterns to exclude from consistency analysis.
ExportReport SwitchParameter optionalposition: namedpipeline: False
Export detailed consistency report to the artifacts directory.
FailOnInconsistency SwitchParameter optionalposition: namedpipeline: False
Fail the build if consistency issues are found.
IncludePatterns String[] optionalposition: namedpipeline: False
Custom include patterns (override default project kind patterns).
LineEndingOverrides Hashtable optionalposition: namedpipeline: False
Per-path line ending overrides (patterns mapped to line endings).
MaxInconsistencyPercentage Int32 optionalposition: namedpipeline: False
Maximum percentage of files that can have consistency issues. Default is 5.
ProjectKind Nullable`1 optionalposition: namedpipeline: False
Project kind used to derive default include patterns.
ReportFileName String optionalposition: namedpipeline: False
Custom filename for the consistency report.
RequiredEncoding FileConsistencyEncoding optionalposition: namedpipeline: Falsevalues: 7
Required file encoding.
Possible values: ASCII, UTF8, UTF8BOM, Unicode, BigEndianUnicode, UTF7, UTF32
RequiredLineEnding FileConsistencyLineEnding optionalposition: namedpipeline: Falsevalues: 2
Required line ending style.
Possible values: CRLF, LF
Scope FileConsistencyScope optionalposition: namedpipeline: Falsevalues: 3
Scope for file consistency checks (staging/project).
Possible values: StagingOnly, ProjectOnly, StagingAndProject
Severity Nullable`1 optionalposition: namedpipeline: False
Severity for consistency issues (overrides FailOnInconsistency when specified).
UpdateProjectRoot SwitchParameter optionalposition: namedpipeline: False
Legacy switch. When set, applies encoding/line-ending consistency fixes to the project root as well as staging output.

Outputs

System.Object