Skip to content

Task Convert_Pester_Coverage fails with error Failed to compare two elements in the array #511

@johlju

Description

@johlju

Problem description

This happens when running PowerShell 7.5.0.

See issue PoshCode/ModuleBuilder#131

Verbose logs

ERROR: Exception calling "BinarySearch" with "2" argument(s): "Failed to compare two elements in the array."
At /Users/johlju/source/Viscalyx.Assert/output/RequiredModules/Sampler/0.118.2/tasks/JaCoCo.coverage.build.ps1:384 char:23
+ … edCommands | Convert-LineNumber -ErrorAction 'Stop' -PassThru | Out-N …
+                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At /Users/johlju/source/Viscalyx.Assert/output/RequiredModules/Sampler/0.118.2/tasks/JaCoCo.coverage.build.ps1:245 char:1

How to reproduce

See issue comment PoshCode/ModuleBuilder#131 (comment)

Expected behavior

Tasks runs without error.

Current behavior

Tasks fail when using PowerShell 7.5.0

Suggested solution

Revert to PowerShell 7.4.x or do not run the task until it is resolved in ModouleBuilder.

Operating system the target node is running

n/a

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Darwin 23.6.0 Darwin Kernel Version 23.6.0: Fri Nov 15 15:13:28 PST 2024; root:xnu-10063.141.1.70…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module version used

0.118.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThe issue cannot be resolved within the DSC Resource Kit.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions