# Get-ProjectConsistency

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

Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`None`

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

## Syntax

```
Get-ProjectConsistency
[-CustomExtensions <String[]>]
[-ExcludeDirectories <String[]>]
[-ExportPath <String>]
-Path <String>
[-ProjectType <PowerShell|CSharp|Mixed|All|Custom>]
[-RecommendedEncoding <TextEncodingKind>]
[-RecommendedLineEnding <CRLF|LF>]
[-ShowDetails]
[<CommonParameters>]
```

[#](#method-get-projectconsistency-string-string-string-string-string-textencodingkind-fileconsistencylineending-switchparameter)

Parameter set: `All Parameter Sets`

## Description

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

### Analyze a PowerShell project with defaults

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

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

### Analyze with explicit recommendations and detailed output

```powershell
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

```powershell
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.

## Parameters

**-CustomExtensions String[] optional**

Custom file extensions to analyze when ProjectType is Custom (e.g., *.ps1, *.cs).

**-ExcludeDirectories String[] optional**

Directory names to exclude from analysis (e.g., .git, bin, obj).

**-ExportPath String optional**

Export the detailed report to a CSV file at the specified path.

**-Path String required**

Path to the project directory to analyze.

**-ProjectType String optional**

Type of project to analyze. Determines which file extensions are included.

Possible values: `PowerShell`, `CSharp`, `Mixed`, `All`, `Custom`

**-RecommendedEncoding TextEncodingKind optional**

The encoding standard you want to achieve (optional).

Possible values: `Ascii`, `BigEndianUnicode`, `Unicode`, `UTF7`, `UTF8`, `UTF8BOM`, `UTF32`, `Default`, `OEM`, `Any`

**-RecommendedLineEnding FileConsistencyLineEnding optional**

The line ending standard you want to achieve (optional).

Possible values: `CRLF`, `LF`

**-ShowDetails SwitchParameter optional**

Include detailed file-by-file analysis in the output.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:AE4E3D1F93105FBAAB2CE1D02B2D93F4DE106AF30AF788E1C8DB1604E0AABB3F -->
