en-US/about_PesterConfiguration.help.txt

TOPIC
    about_PesterConfiguration
 
SHORT DESCRIPTION
    Pester uses a PesterConfiguration-object to configure all of it's options. It is the source of truth for the defaults and provides all supported options.
 
LONG DESCRIPTION
    Pester can be invoked using either a limited set of parameters in Invoke-Pester (Simple interface) or
    by providing a PesterConfiguration object (Advanced interface) that supports all available options.
 
    When Invoke-Pester is invoked using the simple parameters it is internally translated to a full configuration-object,
    using the default values for any undefined options.
 
    The configuration object can be navigated interactively in the console to view all options including description, current and default values.
 
EXAMPLE
    Below we can se an example of how to run Pester using a configuration object:
 
    # Get default configuration
    $configuration = New-PesterConfiguration
    # Changing a few options including the path for our test files.
    $configuration.Run.Path = '.\tests'
    $configuration.Filter.Tag = 'Acceptance'
    $configuration.Filter.ExcludeTag = 'WindowsOnly'
    $configuration.Output.Verbosity = 'Detailed'
    # Run Pester
    Invoke-Pester -Configuration $configuration
 
SECTIONS AND OPTIONS
 
    Run:
        Path: Directories to be searched for tests, paths directly to test files, or combination of both.
        Type: string[]
        Default value: @('.')
 
        ExcludePath: Directories or files to be excluded from the run.
        Type: string[]
        Default value: @()
 
        ScriptBlock: ScriptBlocks containing tests to be executed.
        Type: scriptblock[]
        Default value: @()
 
        Container: ContainerInfo objects containing tests to be executed.
        Type: Pester.ContainerInfo[]
        Default value: @()
 
        TestExtension: Filter used to identify test files.
        Type: string
        Default value: '.Tests.ps1'
 
        Exit: Exit with non-zero exit code when the test run fails. Exit code is always set to `$LASTEXITCODE` even when this option is `$false`. When used together with Throw, throwing an exception is preferred.
        Type: bool
        Default value: $false
 
        Throw: Throw an exception when test run fails. When used together with Exit, throwing an exception is preferred.
        Type: bool
        Default value: $false
 
        PassThru: Return result object to the pipeline after finishing the test run.
        Type: bool
        Default value: $false
 
        SkipRun: Runs the discovery phase but skips run. Use it with PassThru to get object populated with all tests.
        Type: bool
        Default value: $false
 
        SkipRemainingOnFailure: Skips remaining tests after failure for selected scope, options are None, Run, Container and Block.
        Type: string
        Default value: 'None'
 
        FailOnNullOrEmptyForEach: Fails discovery when -ForEach is provided $null or @() in a block or test. Can be overriden for a specific Describe/Context/It using -AllowNullOrEmptyForEach.
        Type: bool
        Default value: $true
 
    Filter:
        Tag: Tags of Describe, Context or It to be run.
        Type: string[]
        Default value: @()
 
        ExcludeTag: Tags of Describe, Context or It to be excluded from the run.
        Type: string[]
        Default value: @()
 
        Line: Filter by file and scriptblock start line, useful to run parsed tests programmatically to avoid problems with expanded names. Explicit filter that overrides -Skip. Example: 'C:\tests\file1.Tests.ps1:37'
        Type: string[]
        Default value: @()
 
        ExcludeLine: Exclude by file and scriptblock start line, takes precedence over Line.
        Type: string[]
        Default value: @()
 
        FullName: Full name of test with -like wildcards, joined by dot. Example: '*.describe Get-Item.test1'
        Type: string[]
        Default value: @()
 
    CodeCoverage:
        Enabled: Enable CodeCoverage.
        Type: bool
        Default value: $false
 
        OutputFormat: Format to use for code coverage report. Possible values: JaCoCo, CoverageGutters, Cobertura
        Type: string
        Default value: 'JaCoCo'
 
        OutputPath: Path relative to the current directory where code coverage report is saved.
        Type: string
        Default value: 'coverage.xml'
 
        OutputEncoding: Encoding of the output file.
        Type: string
        Default value: 'UTF8'
 
        Path: Directories or files to be used for code coverage, by default the Path(s) from general settings are used, unless overridden here.
        Type: string[]
        Default value: @()
 
        ExcludeTests: Exclude tests from code coverage. This uses the TestFilter from general configuration.
        Type: bool
        Default value: $true
 
        RecursePaths: Will recurse through directories in the Path option.
        Type: bool
        Default value: $true
 
        CoveragePercentTarget: Target percent of code coverage that you want to achieve, default 75%.
        Type: decimal
        Default value: 75
 
        UseBreakpoints: When false, use Profiler based tracer to do CodeCoverage instead of using breakpoints.
        Type: bool
        Default value: $false
 
        SingleHitBreakpoints: Remove breakpoint when it is hit. This increases performance of breakpoint based CodeCoverage.
        Type: bool
        Default value: $true
 
    TestResult:
        Enabled: Enable TestResult.
        Type: bool
        Default value: $false
 
        OutputFormat: Format to use for test result report. Possible values: NUnitXml, NUnit2.5, NUnit3 or JUnitXml
        Type: string
        Default value: 'NUnitXml'
 
        OutputPath: Path relative to the current directory where test result report is saved.
        Type: string
        Default value: 'testResults.xml'
 
        OutputEncoding: Encoding of the output file.
        Type: string
        Default value: 'UTF8'
 
        TestSuiteName: Set the name assigned to the root 'test-suite' element.
        Type: string
        Default value: 'Pester'
 
    Should:
        ErrorAction: Controls if Should throws on error. Use 'Stop' to throw on error, or 'Continue' to fail at the end of the test.
        Type: string
        Default value: 'Stop'
 
        DisableV5: Disables usage of Should -Be assertions, that are replaced by Should-Be in version 6.
        Type: bool
        Default value: $false
 
    Debug:
        ShowFullErrors: Show full errors including Pester internal stack. This property is deprecated, and if set to true it will override Output.StackTraceVerbosity to 'Full'.
        Type: bool
        Default value: $false
 
        WriteDebugMessages: Write Debug messages to screen.
        Type: bool
        Default value: $false
 
        WriteDebugMessagesFrom: Write Debug messages from a given source, WriteDebugMessages must be set to true for this to work. You can use like wildcards to get messages from multiple sources, as well as * to get everything.
        Type: string[]
        Default value: @('Discovery', 'Skip', 'Mock', 'CodeCoverage')
 
        ShowNavigationMarkers: Write paths after every block and test, for easy navigation in VSCode.
        Type: bool
        Default value: $false
 
        ReturnRawResultObject: Returns unfiltered result object, this is for development only. Do not rely on this object for additional properties, non-public properties will be renamed without previous notice.
        Type: bool
        Default value: $false
 
    Output:
        Verbosity: The verbosity of output, options are None, Normal, Detailed and Diagnostic.
        Type: string
        Default value: 'Normal'
 
        StackTraceVerbosity: The verbosity of stacktrace output, options are None, FirstLine, Filtered and Full.
        Type: string
        Default value: 'Filtered'
 
        CIFormat: The CI format of error output in build logs, options are None, Auto, AzureDevops and GithubActions.
        Type: string
        Default value: 'Auto'
 
        CILogLevel: The CI log level in build logs, options are Error and Warning.
        Type: string
        Default value: 'Error'
 
        RenderMode: The mode used to render console output, options are Auto, Ansi, ConsoleColor and Plaintext.
        Type: string
        Default value: 'Auto'
 
    TestDrive:
        Enabled: Enable TestDrive.
        Type: bool
        Default value: $true
 
    TestRegistry:
        Enabled: Enable TestRegistry.
        Type: bool
        Default value: $true
 
SEE ALSO
    Pester website: https://pester.dev
    New-PesterConfiguration
    Invoke-Pester