Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
BigWorkk please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
2 similar comments
|
BigWorkk please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
BigWorkk please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
🟡 Changes recommended
The new Windows test collides with a file created by the preceding test, preventing successful validation.
1 open finding
What changed in this PR
Reduces allocations when formatting executable filenames on Windows.
Changes:
- Replaces extension lowercasing with an ordinal case-insensitive comparison.
- Adds a regression test for uppercase
.EXEfilenames.
| File | Description |
|---|---|
| test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 | Adds uppercase-extension formatting coverage. |
| src/System.Management.Automation/namespaces/FileSystemProvider.cs | Avoids lowercasing extensions during executable detection. |
🧠 Review effort: Balanced


PR Summary
Avoid allocating a lowercased copy of each file extension while formatting filesystem entries on Windows. Compare against cached PATHEXT entries with
StringComparer.OrdinalIgnoreCaseinstead.PR Context
FileSystemProvider.NameStringchecks every formatted file to determine whether it is executable. The previous check allocated a normalized extension string for each file; this change keeps the same case-insensitive matching without that per-file allocation. A focused regression test covers uppercase.EXEnames.Validation:
Import-Module ./tools/ci.psm1 -Force; Start-PSBuild -NoPSModuleRestorepassed using the required .NET SDK 11.0.100-rc.1.26425.128. The built PowerShell runtime check for uppercase.EXEpassed and the test file parsed without errors. The full Pester test file was not run: the available Pester 3.4.0 module is incompatible with this repository's Pester assertions.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header