Skip to content

Commit db218a0

Browse files
azure-sdkswathipil
andauthored
Update New-TestResources.ps1 to add quotes around shell envvar (Azure#37650)
Co-authored-by: swathipil <[email protected]>
1 parent ba91013 commit db218a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eng/common/TestResources/New-TestResources.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ try {
515515

516516
# Try to detect the shell based on the parent process name (e.g. launch via shebang).
517517
$shell, $shellExportFormat = if (($parentProcessName = (Get-Process -Id $PID).Parent.ProcessName) -and $parentProcessName -eq 'cmd') {
518-
'cmd', 'set {0}={1}'
518+
'cmd', 'set {0}=''{1}'''
519519
} elseif (@('bash', 'csh', 'tcsh', 'zsh') -contains $parentProcessName) {
520-
'shell', 'export {0}={1}'
520+
'shell', 'export {0}=''{1}'''
521521
} else {
522522
'PowerShell', '${{env:{0}}} = ''{1}'''
523523
}

0 commit comments

Comments
 (0)