Skip to content

Commit de974c8

Browse files
authored
issue #3507 (#3508)
#3507 Co-authored-by: freddydk <[email protected]>
1 parent cb965cb commit de974c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ContainerHandling/Invoke-ScriptInNavContainer.ps1

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ function Invoke-ScriptInBcContainer {
3030
[bool] $usePwsh = $bccontainerHelperConfig.usePwshForBc24
3131
)
3232

33+
$file = ''
3334
if (!$useSession) {
3435
$file = Join-Path $bcContainerHelperConfig.hostHelperFolder ([GUID]::NewGuid().Tostring()+'.ps1')
35-
$containerFile = $containerFile = Get-BcContainerPath -containerName $containerName -path $file
36+
$containerFile = Get-BcContainerPath -containerName $containerName -path $file
3637
if ($isInsideContainer -or "$containerFile" -eq "") {
3738
$useSession = $true
3839
}
@@ -111,6 +112,10 @@ function Invoke-ScriptInBcContainer {
111112
throw $errorMessage
112113
}
113114
} else {
115+
if ($file -eq '') {
116+
$file = Join-Path $bcContainerHelperConfig.hostHelperFolder ([GUID]::NewGuid().Tostring()+'.ps1')
117+
$containerFile = Get-BcContainerPath -containerName $containerName -path $file
118+
}
114119
if ("$containerFile" -eq "") {
115120
throw "$($bcContainerHelperConfig.hostHelperFolder) is not shared with the container, cannot invoke scripts in container without using a session"
116121
}

0 commit comments

Comments
 (0)