Skip to content

Commit

Permalink
Update New-TestResources.ps1 to add quotes around shell envvar (#9074)
Browse files Browse the repository at this point in the history
  • Loading branch information
swathipil authored Oct 2, 2024
1 parent db83079 commit a76f3d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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}'''
}
Expand Down

0 comments on commit a76f3d2

Please sign in to comment.