Draft
Conversation
…ard chars Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
… validate early Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…rt paths early Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…et-ChildItem Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…ursively Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…ption is set Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…ing as Administrator Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…event report failure Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…ed, not Passed Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
…ent infinite loop Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> Agent-Logs-Url: https://github.com/pester/Pester/sessions/909bc4f5-f7bd-42cd-b476-fc9645267f23
Copilot created this pull request from a session on behalf of
nohwnd
March 20, 2026 19:33
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 12 open issues from the Pester 6 milestone across several areas of the codebase.
Changes
Assertions
The
-Existparameter ofShouldcannot find the file if the file name contains a wildcard character #2628 —Should -Existfails when path contains wildcard characters ([,]): ChangedTest-Path $ActualValuetoTest-Path -LiteralPath $ActualValueso paths with literal bracket characters are found correctly.Infinite loop for
FileInfoandDirectoryInfodue toRootproperties inDirectoryInfo. Should we restrict depth as a general fix in addition to specialcasingDirectoryInfoinGet-DisplayProperty2? #2474 — Infinite loop when formattingFileInfo/DirectoryInfoobjects (viaRootcircular property): AddedSystem.IO.DirectoryInfoandSystem.IO.FileInfoto the display property map inGet-DisplayProperty2.Test Results / Coverage Output
TestResults.OutputEncoding option ignored #2452 —
TestResults.OutputEncodingconfiguration option was completely ignored (always wrote UTF-8): Added$Encodingparameter toExport-PesterResultandExport-XmlReport;XmlWriterSettings.Encodingis now set from the configured encoding name.Invoke-Pester breaks on invalid CodeCoverage.OutputEncoding format #2451 — Invalid
CodeCoverage.OutputEncodingcaused an ugly exception at the very end ofInvoke-Pester: Added early encoding validation inResolve-CodeCoverageConfiguration. Also added the same early validation toResolve-TestResultConfigurationforTestResults.OutputEncoding.Get-CimInstance(non failing) error when running Pester not as Administrator #2678 —Get-CimInstance : Access deniederror printed when Pester runs without Administrator rights: Added-ErrorAction Ignoreto bothGet-CimInstanceandGet-WmiObjectcalls inGet-RunTimeEnvironment, with a null fallback for the OS info.Error during handling of output-element with state based ToString() Implementation #2649 — NUnit3 report writing crashes when a test output object's
ToString()method throws: Wrapped theToString()call inFormat-CDataStringwith atry/catchthat substitutes a descriptive fallback string.Runtime / Discovery
Error in BeforeAll of Data driven tests leads to missing info in the error output #2571 — Data-driven block (
-ForEach) name template (e.g.<_>) is not expanded in error output whenBeforeAllfails: Moved the block-name expansion scriptblock inOuterSetupto run beforeOneTimeTestSetup(BeforeAll), so the name is always expanded even on BeforeAll failure.Test discovery on linux fails to find tests in hidden folders #2515 — Test discovery on Linux skips hidden (dot-prefixed) folders like
.github: Added-Forceto bothGet-ChildItemcalls inFind-File.Relative paths for reports are relative to current folder after all tests completed, not to the original pester folder. #2641 — Relative output report paths resolve against the current directory after all tests run (which may differ from the invocation directory if tests call
Set-Location): Added aStartplugin step toGet-TestResultPluginthat resolves the output path to an absolute path early, before tests execute.Pester clears test drives inefficiently #2657 —
Clear-TestDrivewas extremely slow with many files because it calledRemove-Itemon every individual file, including files already deleted by earlier recursive calls: Replaced the naive per-item loop with a HashSet-based approach that only callsRemove-Item -Recurseon "root" new items (items whose parent is not also new).Configuration / Usability
setting any option to non default on testResult or code coverage should enable them #2682 — Users must explicitly set
Enabled = $trueeven when configuring otherTestResult/CodeCoverageoptions: Added auto-enable logic inInvoke-Pesterthat uses theIsModifiedproperty to detect user-configured options and automatically enables the feature.Container is reported as Passed/Successful when discovery fails #2538 — Container and block containing a discovery error are reported as
Passed/Successfulin the result object: Reordered the result-computation logic inPostProcess-RSpecTestRunso that a non-emptyErrorRecordalways yieldsFailed, regardless ofPassed.Security Summary
No security vulnerabilities were introduced or identified in these changes.