Fix path handling bug in PSTask#12554
Conversation
`ForEach-Object -Parallel` should work just the same when $PWD has wildcard characters in their names
vexx32
left a comment
There was a problem hiding this comment.
Looks good to me, nice work!
Tests look good I think, just noticed a small style thing in one section that's really bugging me, but nothing serious. 😁
test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1
Outdated
Show resolved
Hide resolved
|
@IISResetMe I have started a code review and discover that the fix is only partial. I found at least two scenario where wildcards broke set location:
Result of my investigations is in https://github.com/iSazonov/PowerShell/tree/fix-cd-literalpath
|
…bject-Parallel.Tests.ps1 Co-authored-by: Joel Sallow (/u/ta11ow) <[email protected]>
|
@IISResetMe Please fix the CodeFactor issues. |
…b.com/IISResetMe/PowerShell into fix/ForEach-Object-Parallel-path-test
|
I think it makes no sense to merge the PR because follow more general fix will revert it - the general fix is in another place. |
|
@IISResetMe Do you want to work on general fix? |
|
Yeah I can do a broader patch for this and related behavior, but might take a few days, looks like |
|
@IISResetMe Thanks for your contribution! |
|
🎉 Handy links: |
PR Summary
This PR changes the behavior PSTask to always treat the current $PWD as a literal path, in turn allowing
ForEach-Object -Parallelto execute correctly when invoked from a path with wildcard characters in the name.PR Context
Fixes #12428
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.