@@ -44,7 +44,7 @@ export async function startPowerShellSession(this: NovaWindowsDriver): Promise<v
4444 }
4545 const envVars = Array . from ( envVarsSet ) ;
4646 for ( const envVar of envVars ) {
47- this . caps . appWorkingDir = this . caps . appWorkingDir . replaceAll ( `%${ envVar } %` , process . env [ envVar . toUpperCase ( ) ] ?? '' ) ;
47+ this . caps . appWorkingDir = this . caps . appWorkingDir . replaceAll ( `%${ envVar } %` , spawnEnv [ envVar . toUpperCase ( ) ] ?? '' ) ;
4848 }
4949 this . sendPowerShellCommand ( `Set-Location -Path '${ this . caps . appWorkingDir } '` ) ;
5050 }
@@ -82,7 +82,7 @@ export async function startPowerShellSession(this: NovaWindowsDriver): Promise<v
8282 this . log . info ( `Detected the following environment variables in app path: ${ envVars . map ( ( envVar ) => `%${ envVar } %` ) . join ( ', ' ) } ` ) ;
8383
8484 for ( const envVar of envVars ) {
85- this . caps . app = this . caps . app . replaceAll ( `%${ envVar } %` , process . env [ envVar . toUpperCase ( ) ] ?? '' ) ;
85+ this . caps . app = this . caps . app . replaceAll ( `%${ envVar } %` , spawnEnv [ envVar . toUpperCase ( ) ] ?? '' ) ;
8686 }
8787
8888 await this . changeRootElement ( this . caps . app ) ;
@@ -108,7 +108,6 @@ export async function sendIsolatedPowerShellCommand(this: NovaWindowsDriver, com
108108 const powerShell = spawn ( 'powershell.exe' , [ '-NoExit' , '-Command' , '-' ] , { env : spawnEnv } ) ;
109109 try {
110110 powerShell . stdout . setEncoding ( 'utf8' ) ;
111- powerShell . stdout . setEncoding ( 'utf8' ) ;
112111
113112 let localStdOut = '' ;
114113 let localStdErr = '' ;
@@ -135,7 +134,7 @@ export async function sendIsolatedPowerShellCommand(this: NovaWindowsDriver, com
135134 }
136135 const envVars = Array . from ( envVarsSet ) ;
137136 for ( const envVar of envVars ) {
138- this . caps . appWorkingDir = this . caps . appWorkingDir . replaceAll ( `%${ envVar } %` , process . env [ envVar . toUpperCase ( ) ] ?? '' ) ;
137+ this . caps . appWorkingDir = this . caps . appWorkingDir . replaceAll ( `%${ envVar } %` , spawnEnv [ envVar . toUpperCase ( ) ] ?? '' ) ;
139138 }
140139 powerShell . stdin . write ( `Set-Location -Path '${ this . caps . appWorkingDir } '\n` ) ;
141140 }
0 commit comments