diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 6ccf55a781c..dbb8c4f2033 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -515,9 +515,9 @@ try { # Try to detect the shell based on the parent process name (e.g. launch via shebang). $shell, $shellExportFormat = if (($parentProcessName = (Get-Process -Id $PID).Parent.ProcessName) -and $parentProcessName -eq 'cmd') { - 'cmd', 'set {0}={1}' + 'cmd', 'set {0}=''{1}''' } elseif (@('bash', 'csh', 'tcsh', 'zsh') -contains $parentProcessName) { - 'shell', 'export {0}={1}' + 'shell', 'export {0}=''{1}''' } else { 'PowerShell', '${{env:{0}}} = ''{1}''' }