Skip to content

Commit 4806cd4

Browse files
Peter HaugeCopilot
andcommitted
fix: set child process CWD to PowerShell's $PWD in Invoke-MaskedProcess
PowerShell's Set-Location updates $PWD but not .NET's [Environment]::CurrentDirectory. Invoke-MaskedProcess uses System.Diagnostics.Process which inherits the .NET CWD, causing relative paths (like --output ./extracted-artifacts2) to resolve from the repo root instead of the test directory. Set WorkingDirectory = $PWD.Path so child processes use the same directory as the calling PowerShell session. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d320668 commit 4806cd4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/integration/all-resource-types/modules/LogMasking.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ function Invoke-MaskedProcess {
264264

265265
$psi = [System.Diagnostics.ProcessStartInfo]::new()
266266
$psi.FileName = $exe.FilePath
267+
$psi.WorkingDirectory = $PWD.Path
267268
$psi.RedirectStandardOutput = $true
268269
$psi.RedirectStandardError = $true
269270
$psi.RedirectStandardInput = $true

0 commit comments

Comments
 (0)