Skip to content

Latest commit

 

History

History
756 lines (608 loc) · 16.1 KB

File metadata and controls

756 lines (608 loc) · 16.1 KB
external help file PSPublishModule-help.xml
Module Name PSPublishModule
online version https://github.com/EvotecIT/PSPublishModule
schema 2.0.0

New-ConfigurationValidation

SYNOPSIS

Creates configuration for module validation checks during build.

SYNTAX

__AllParameterSets

New-ConfigurationValidation [-Enable] [-StructureSeverity <ValidationSeverity>] [-DocumentationSeverity <ValidationSeverity>] [-ScriptAnalyzerSeverity <ValidationSeverity>] [-FileIntegritySeverity <ValidationSeverity>] [-TestsSeverity <ValidationSeverity>] [-BinarySeverity <ValidationSeverity>] [-CsprojSeverity <ValidationSeverity>] [-PublicFunctionPaths <string[]>] [-InternalFunctionPaths <string[]>] [-ValidateManifestFiles <bool>] [-ValidateExports <bool>] [-ValidateInternalNotExported <bool>] [-AllowWildcardExports <bool>] [-MinSynopsisPercent <int>] [-MinDescriptionPercent <int>] [-MinExamplesPerCommand <int>] [-MinParameterDescriptionPercent <int>] [-MinTypeDescriptionPercent <int>] [-ExcludeCommands <string[]>] [-EnableScriptAnalyzer] [-ScriptAnalyzerExcludeDirectories <string[]>] [-ScriptAnalyzerExcludeRules <string[]>] [-ScriptAnalyzerSkipIfUnavailable <bool>] [-ScriptAnalyzerInstallIfUnavailable <bool>] [-ScriptAnalyzerTimeoutSeconds <int>] [-FileIntegrityExcludeDirectories <string[]>] [-FileIntegrityCheckTrailingWhitespace <bool>] [-FileIntegrityCheckSyntax <bool>] [-BannedCommands <string[]>] [-AllowBannedCommandsIn <string[]>] [-EnableTests] [-TestsPath <string>] [-TestAdditionalModules <string[]>] [-TestSkipModules <string[]>] [-TestSkipDependencies] [-TestSkipImport] [-TestForce] [-TestTimeoutSeconds <int>] [-ValidateBinaryAssemblies <bool>] [-ValidateBinaryExports <bool>] [-AllowBinaryWildcardExports <bool>] [-RequireTargetFramework <bool>] [-RequireLibraryOutput <bool>] [<CommonParameters>]

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

EXAMPLE 1

PS> New-ConfigurationValidation -Enable -StructureSeverity Error -DocumentationSeverity Warning

EXAMPLE 2

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

PARAMETERS

-AllowBannedCommandsIn

File names allowed to use banned commands.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-AllowBinaryWildcardExports

Allow wildcard exports for binary checks.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-AllowWildcardExports

Allow wildcard exports (skip export validation if FunctionsToExport='*').

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-BannedCommands

Commands that should not appear in scripts.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-BinarySeverity

Severity for binary export checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-CsprojSeverity

Severity for csproj validation checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-DocumentationSeverity

Severity for documentation checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Enable

Enable module validation checks during build.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-EnableScriptAnalyzer

Enable PSScriptAnalyzer checks during validation.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-EnableTests

Enable test execution during validation.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ExcludeCommands

Command names to exclude from documentation checks.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-FileIntegrityCheckSyntax

Check for PowerShell syntax errors.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-FileIntegrityCheckTrailingWhitespace

Check for trailing whitespace in scripts.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-FileIntegrityExcludeDirectories

Directories to exclude from file integrity checks.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-FileIntegritySeverity

Severity for file integrity checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-InternalFunctionPaths

Relative paths to internal function files (default: "internal\functions").

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-MinDescriptionPercent

Minimum description coverage percentage (default 100).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-MinExamplesPerCommand

Minimum examples per command (default 1).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-MinParameterDescriptionPercent

Minimum percentage of parameters that must have descriptions (default 0 = disabled).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-MinSynopsisPercent

Minimum synopsis coverage percentage (default 100).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-MinTypeDescriptionPercent

Minimum percentage of unique input/output types that must have descriptions (default 0 = disabled).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-PublicFunctionPaths

Relative paths to public function files (default: "functions").

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-RequireLibraryOutput

Require OutputType=Library in csproj (when specified).

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-RequireTargetFramework

Require TargetFramework/TargetFrameworks in csproj.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerExcludeDirectories

Directories to exclude from PSScriptAnalyzer checks.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerExcludeRules

PSScriptAnalyzer rules to exclude.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerInstallIfUnavailable

Install PSScriptAnalyzer on demand before validation when it is missing.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerSeverity

Severity for PSScriptAnalyzer checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerSkipIfUnavailable

Skip PSScriptAnalyzer checks if the module is not installed.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ScriptAnalyzerTimeoutSeconds

ScriptAnalyzer timeout, in seconds (default 300).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-StructureSeverity

Severity for module structure checks.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestAdditionalModules

Additional modules to install for tests.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestForce

Force dependency reinstall and module reimport during tests.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestSkipDependencies

Skip dependency installation during tests.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestSkipImport

Skip importing the module during tests.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestSkipModules

Module names to skip during test dependency installation.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestsPath

Path to tests (defaults to Tests under project root).

Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestsSeverity

Severity for test failures.

Type: ValidationSeverity
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: Off, Warning, Error

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestTimeoutSeconds

Test timeout, in seconds (default 600).

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ValidateBinaryAssemblies

Validate that binary assemblies exist.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ValidateBinaryExports

Validate binary exports against CmdletsToExport/AliasesToExport.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ValidateExports

Validate that FunctionsToExport matches public functions.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ValidateInternalNotExported

Validate that internal functions are not exported.

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ValidateManifestFiles

Validate manifest file references (RootModule/Formats/Types/RequiredAssemblies).

Type: Boolean
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

  • None

OUTPUTS

  • System.Object

RELATED LINKS

  • None