Skip to content

Commit

Permalink
issue #3507 (#3508)
Browse files Browse the repository at this point in the history
#3507

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
  • Loading branch information
freddydk and freddydk committed Apr 24, 2024
1 parent cb965cb commit de974c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ContainerHandling/Invoke-ScriptInNavContainer.ps1
Expand Up @@ -30,9 +30,10 @@ function Invoke-ScriptInBcContainer {
[bool] $usePwsh = $bccontainerHelperConfig.usePwshForBc24
)

$file = ''
if (!$useSession) {
$file = Join-Path $bcContainerHelperConfig.hostHelperFolder ([GUID]::NewGuid().Tostring()+'.ps1')
$containerFile = $containerFile = Get-BcContainerPath -containerName $containerName -path $file
$containerFile = Get-BcContainerPath -containerName $containerName -path $file
if ($isInsideContainer -or "$containerFile" -eq "") {
$useSession = $true
}
Expand Down Expand Up @@ -111,6 +112,10 @@ function Invoke-ScriptInBcContainer {
throw $errorMessage
}
} else {
if ($file -eq '') {
$file = Join-Path $bcContainerHelperConfig.hostHelperFolder ([GUID]::NewGuid().Tostring()+'.ps1')
$containerFile = Get-BcContainerPath -containerName $containerName -path $file
}
if ("$containerFile" -eq "") {
throw "$($bcContainerHelperConfig.hostHelperFolder) is not shared with the container, cannot invoke scripts in container without using a session"
}
Expand Down

0 comments on commit de974c8

Please sign in to comment.