Update New-TestResources.ps1 to add quotes around shell envvar (#6050)

Co-authored-by: swathipil <swathip@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-10-02 13:14:52 -07:00 committed by GitHub
parent d22781c84a
commit 90bd17c5b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}'''
}