-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Closed
Copy link
Labels
Hacktoberfest-AcceptedAccepted to participate in HacktoberfestAccepted to participate in HacktoberfestIssue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
PR #10324 is merged and now we can use -WorkingDirectory when starting a job for background invocation operator.
The following code can be replaced:
PowerShell/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs
Lines 529 to 532 in f69f30b
| 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
mklement0
Metadata
Metadata
Assignees
Labels
Hacktoberfest-AcceptedAccepted to participate in HacktoberfestAccepted to participate in HacktoberfestIssue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime