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

Module PSPublishModule
Inputs
None

Creates configuration for module validation checks during build.

Syntax

New-ConfigurationValidation [-AllowBannedCommandsIn <String[]>] [-AllowBinaryWildcardExports <Boolean>] [-AllowWildcardExports <Boolean>] [-BannedCommands <String[]>] [-BinarySeverity <Off|Warning|Error>] [-CsprojSeverity <Off|Warning|Error>] [-DocumentationSeverity <Off|Warning|Error>] [-Enable] [-EnableScriptAnalyzer] [-EnableTests] [-ExcludeCommands <String[]>] [-FileIntegrityCheckSyntax <Boolean>] [-FileIntegrityCheckTrailingWhitespace <Boolean>] [-FileIntegrityExcludeDirectories <String[]>] [-FileIntegritySeverity <Off|Warning|Error>] [-InternalFunctionPaths <String[]>] [-MinDescriptionPercent <Int32>] [-MinExamplesPerCommand <Int32>] [-MinParameterDescriptionPercent <Int32>] [-MinSynopsisPercent <Int32>] [-MinTypeDescriptionPercent <Int32>] [-PublicFunctionPaths <String[]>] [-RequireLibraryOutput <Boolean>] [-RequireTargetFramework <Boolean>] [-ScriptAnalyzerExcludeDirectories <String[]>] [-ScriptAnalyzerExcludeRules <String[]>] [-ScriptAnalyzerInstallIfUnavailable <Boolean>] [-ScriptAnalyzerSeverity <Off|Warning|Error>] [-ScriptAnalyzerSkipIfUnavailable <Boolean>] [-ScriptAnalyzerTimeoutSeconds <Int32>] [-StructureSeverity <Off|Warning|Error>] [-TestAdditionalModules <String[]>] [-TestForce] [-TestSkipDependencies] [-TestSkipImport] [-TestSkipModules <String[]>] [-TestsPath <String>] [-TestsSeverity <Off|Warning|Error>] [-TestTimeoutSeconds <Int32>] [-ValidateBinaryAssemblies <Boolean>] [-ValidateBinaryExports <Boolean>] [-ValidateExports <Boolean>] [-ValidateInternalNotExported <Boolean>] [-ValidateManifestFiles <Boolean>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Adds a single validation segment that can run structure, documentation, test, binary, and csproj checks. Each check can be configured as Off/Warning/Error to control whether it is informational or blocking.

Encoding and line-ending enforcement is handled by New-ConfigurationFileConsistency.

Examples

Authored help example

Enable validation with warnings for docs and errors for structure

New-ConfigurationValidation -Enable -StructureSeverity Error -DocumentationSeverity Warning

Run tests and fail the build on test failures

New-ConfigurationValidation -Enable -EnableTests -TestsSeverity Error -TestsPath 'Tests'

Parameters

-AllowBannedCommandsIn String[] optional
File names allowed to use banned commands.
-AllowBinaryWildcardExports Boolean optional
Allow wildcard exports for binary checks.
-AllowWildcardExports Boolean optional
Allow wildcard exports (skip export validation if FunctionsToExport='*').
-BannedCommands String[] optional
Commands that should not appear in scripts.
-BinarySeverity ValidationSeverity optional
Severity for binary export checks.
Possible values: Off, Warning, Error
-CsprojSeverity ValidationSeverity optional
Severity for csproj validation checks.
Possible values: Off, Warning, Error
-DocumentationSeverity ValidationSeverity optional
Severity for documentation checks.
Possible values: Off, Warning, Error
-Enable SwitchParameter optional
Enable module validation checks during build.
-EnableScriptAnalyzer SwitchParameter optional
Enable PSScriptAnalyzer checks during validation.
-EnableTests SwitchParameter optional
Enable test execution during validation.
-ExcludeCommands String[] optional
Command names to exclude from documentation checks.
-FileIntegrityCheckSyntax Boolean optional
Check for PowerShell syntax errors.
-FileIntegrityCheckTrailingWhitespace Boolean optional
Check for trailing whitespace in scripts.
-FileIntegrityExcludeDirectories String[] optional
Directories to exclude from file integrity checks.
-FileIntegritySeverity ValidationSeverity optional
Severity for file integrity checks.
Possible values: Off, Warning, Error
-InternalFunctionPaths String[] optional
Relative paths to internal function files (default: "internal\\functions").
-MinDescriptionPercent Int32 optional
Minimum description coverage percentage (default 100).
-MinExamplesPerCommand Int32 optional
Minimum examples per command (default 1).
-MinParameterDescriptionPercent Int32 optional
Minimum percentage of parameters that must have descriptions (default 0 = disabled).
-MinSynopsisPercent Int32 optional
Minimum synopsis coverage percentage (default 100).
-MinTypeDescriptionPercent Int32 optional
Minimum percentage of unique input/output types that must have descriptions (default 0 = disabled).
-PublicFunctionPaths String[] optional
Relative paths to public function files (default: "functions").
-RequireLibraryOutput Boolean optional
Require OutputType=Library in csproj (when specified).
-RequireTargetFramework Boolean optional
Require TargetFramework/TargetFrameworks in csproj.
-ScriptAnalyzerExcludeDirectories String[] optional
Directories to exclude from PSScriptAnalyzer checks.
-ScriptAnalyzerExcludeRules String[] optional
PSScriptAnalyzer rules to exclude.
-ScriptAnalyzerInstallIfUnavailable Boolean optional
Install PSScriptAnalyzer on demand before validation when it is missing.
-ScriptAnalyzerSeverity ValidationSeverity optional
Severity for PSScriptAnalyzer checks.
Possible values: Off, Warning, Error
-ScriptAnalyzerSkipIfUnavailable Boolean optional
Skip PSScriptAnalyzer checks if the module is not installed.
-ScriptAnalyzerTimeoutSeconds Int32 optional
ScriptAnalyzer timeout, in seconds (default 300).
-StructureSeverity ValidationSeverity optional
Severity for module structure checks.
Possible values: Off, Warning, Error
-TestAdditionalModules String[] optional
Additional modules to install for tests.
-TestForce SwitchParameter optional
Force dependency reinstall and module reimport during tests.
-TestSkipDependencies SwitchParameter optional
Skip dependency installation during tests.
-TestSkipImport SwitchParameter optional
Skip importing the module during tests.
-TestSkipModules String[] optional
Module names to skip during test dependency installation.
-TestsPath String optional
Path to tests (defaults to Tests under project root).
-TestsSeverity ValidationSeverity optional
Severity for test failures.
Possible values: Off, Warning, Error
-TestTimeoutSeconds Int32 optional
Test timeout, in seconds (default 600).
-ValidateBinaryAssemblies Boolean optional
Validate that binary assemblies exist.
-ValidateBinaryExports Boolean optional
Validate binary exports against CmdletsToExport/AliasesToExport.
-ValidateExports Boolean optional
Validate that FunctionsToExport matches public functions.
-ValidateInternalNotExported Boolean optional
Validate that internal functions are not exported.
-ValidateManifestFiles Boolean optional
Validate manifest file references (RootModule/Formats/Types/RequiredAssemblies).

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.