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

API Reference

Command

Get-ProjectConsistency

Namespace PSPublishModule
Inputs
None

Provides comprehensive analysis of encoding and line ending consistency across a project.

Remarks

This cmdlet combines encoding and line-ending analysis to provide a single “consistency” view of your repository. It is intended to be run before bulk conversions (encoding/line endings) and before packaging a module for release. For fixing issues during builds, use New-ConfigurationFileConsistency with -AutoFix enabled.

Examples

Authored help example

Analyze a PowerShell project with defaults

PS>


Get-ProjectConsistency -Path 'C:\MyProject' -ProjectType PowerShell
        

Reports encoding and line ending consistency using PowerShell-friendly defaults.

Analyze with explicit recommendations and detailed output

PS>


Get-ProjectConsistency -Path 'C:\MyProject' -ProjectType Mixed -RecommendedEncoding UTF8BOM -RecommendedLineEnding LF -ShowDetails
        

Useful when you want to enforce a policy (e.g. UTF-8 BOM for PS 5.1 compatibility and LF for cross-platform repos).

Export a detailed report to CSV

PS>


Get-ProjectConsistency -Path 'C:\MyProject' -ProjectType CSharp -RecommendedEncoding UTF8 -ExportPath 'C:\Reports\consistency-report.csv'
        

Exports the per-file details so you can review issues outside the console.

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

Get-ProjectConsistency [-CustomExtensions <String[]>] [-ExcludeDirectories <String[]>] [-ExportPath <String>] -Path <String> [-ProjectType <PowerShell|CSharp|Mixed|All|Custom>] [-RecommendedEncoding <Ascii>] [-RecommendedLineEnding <CRLF|LF>] [-ShowDetails] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

CustomExtensions String[] optionalposition: namedpipeline: False
Custom file extensions to analyze when ProjectType is Custom (e.g., *.ps1, *.cs).
ExcludeDirectories String[] optionalposition: namedpipeline: False
Directory names to exclude from analysis (e.g., .git, bin, obj).
ExportPath String optionalposition: namedpipeline: False
Export the detailed report to a CSV file at the specified path.
Path String requiredposition: namedpipeline: False
Path to the project directory to analyze.
ProjectType String optionalposition: namedpipeline: Falsevalues: 5
Type of project to analyze. Determines which file extensions are included.
Possible values: PowerShell, CSharp, Mixed, All, Custom
RecommendedEncoding TextEncodingKind optionalposition: namedpipeline: Falsevalues: 10
The encoding standard you want to achieve (optional).
Possible values: Ascii, BigEndianUnicode, Unicode, UTF7, UTF8, UTF8BOM, UTF32, Default, OEM, Any
RecommendedLineEnding FileConsistencyLineEnding optionalposition: namedpipeline: Falsevalues: 2
The line ending standard you want to achieve (optional).
Possible values: CRLF, LF
ShowDetails SwitchParameter optionalposition: namedpipeline: False
Include detailed file-by-file analysis in the output.