Skip to content
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

& background invocation operator should -WorkingDirectory when starting a job #10515

Closed
adityapatwardhan opened this issue Sep 11, 2019 · 1 comment · Fixed by #16180
Closed
Labels
Hacktoberfest-Accepted Accepted to participate in Hacktoberfest Issue-Code Cleanup the issue is for cleaning up the code with no impact on functionality Resolution-Fixed The issue is fixed. WG-Engine core PowerShell engine, interpreter, and runtime

Comments

@adityapatwardhan
Copy link
Member

PR #10324 is merged and now we can use -WorkingDirectory when starting a job for background invocation operator.

The following code can be replaced:

const string cmdPrefix = @"Microsoft.PowerShell.Management\Set-Location -LiteralPath $using:pwd ; ";
// Minimize allocations by initializing the stringbuilder to the size of the source string + prefix + space for ${using:} * 2
System.Text.StringBuilder updatedScriptblock = new System.Text.StringBuilder(cmdPrefix.Length + scriptblockBodyString.Length + 18);
updatedScriptblock.Append(cmdPrefix);

Steps to reproduce

Expected behavior


Actual behavior


Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-daily.20190906
PSEdition                      Core
GitCommitId                    7.0.0-daily.20190906
OS                             Microsoft Windows 10.0.18978
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@adityapatwardhan adityapatwardhan added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Sep 11, 2019
@iSazonov iSazonov added WG-Engine core PowerShell engine, interpreter, and runtime Issue-Code Cleanup the issue is for cleaning up the code with no impact on functionality Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors and removed Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a labels Jan 30, 2020
@SteveL-MSFT SteveL-MSFT added Hacktoberfest-Accepted Accepted to participate in Hacktoberfest and removed Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors labels Jul 12, 2021
@ayousuf23
Copy link
Contributor

Please assign me to the issue. I submitted a PR for this issue (#16180).

@ghost ghost added the In-PR Indicates that a PR is out for the issue label Feb 1, 2022
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest-Accepted Accepted to participate in Hacktoberfest Issue-Code Cleanup the issue is for cleaning up the code with no impact on functionality Resolution-Fixed The issue is fixed. WG-Engine core PowerShell engine, interpreter, and runtime
Projects
None yet
4 participants