fix(pwsh): use correct workdir for any location

This commit is contained in:
Jan De Dobbeleer 2022-04-16 12:49:27 +02:00 committed by Jan De Dobbeleer
parent 5e02063323
commit 3fcd4c52b1

View file

@ -11,8 +11,8 @@ function global:Start-Utf8Process {
$StartInfo.FileName = $filename
$StartInfo.Arguments = $Arguments
$StartInfo.UseShellExecute = $false
if ($pwd.provider.name -eq "FileSystem") { #workingdirectory does not work with registry path
$StartInfo.WorkingDirectory = convert-path $pwd #when UseShellExecute=false, workingDirectory=""
if ($PWD.Provider.Name -eq 'FileSystem') {
$StartInfo.WorkingDirectory = $PWD.ProviderPath
}
$StartInfo.CreateNoWindow = $true
$_ = $Process.Start();