-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix path handling bug in PSTask #12554
Fix path handling bug in PSTask #12554
Conversation
`ForEach-Object -Parallel` should work just the same when $PWD has wildcard characters in their names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) <32407840+vexx32@users.noreply.github.com>
@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 -Parallel
to execute correctly when invoked from a path with wildcard characters in the name.PR Context
Fixes #12428
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.