Skip to content

Set current working directory of each ForEach-Object -Parallel running script to the same location as the calling script. - #10672

Merged
Dongbo Wang (daxian-dbw) merged 6 commits into
PowerShell:masterfrom
PaulHigin:fix-foreach-parallel-startdir
Oct 4, 2019
Merged

Dongbo Wang (daxian-dbw) merged 6 commits into
PowerShell:masterfrom
PaulHigin:fix-foreach-parallel-startdir

Conversation

@PaulHigin

Copy link
Copy Markdown
Contributor

PR Summary

This changes fixes issue, #10537. It sets each parallel running script block context to have the same working directory location as the calling script.

PR Context

Previously, parallel running script blocks would use the default PowerShell working directory, similar to remoting and job execution. But ForEach-Object -Parallel should run all script in the same working directory as the calling script, to make it consistent with ForEach-Object while running in normal (non-parallel) mode.

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iSazonov Ilya (iSazonov) added CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log and removed WG-Cmdlets general cmdlet issues Issue-Bug Issue has been identified as a bug in the product labels Oct 2, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.5 milestone Oct 2, 2019

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor comment.

@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

Ryan Yates (kilasuit) pushed a commit to kilasuit/PowerShell that referenced this pull request Nov 9, 2019
…ing script to the same location as the calling script. (PowerShell#10672)
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…ing script to the same location as the calling script. (PowerShell#10672)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants