Skip to content

Commit

Permalink
Freddydk/filesonlyperf (#3745)
Browse files Browse the repository at this point in the history
filesonly containers doesn't work with winrm sessions

Fixes microsoft/AL-Go#1284

---------

Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk authored Oct 31, 2024
1 parent 52a2b3e commit f0dafc0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ContainerHandling/Get-NavContainerSession.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ function Get-BcContainerSession {
Process {
$newsession = $false
$session = $null
[System.Version]$platformVersion = Get-BcContainerPlatformVersion -containerOrImageName $containerName
$inspect = docker inspect $containerName | ConvertFrom-Json
if (!($inspect.Config.Labels.psobject.Properties.Name -eq 'maintainer' -and $inspect.Config.Labels.maintainer -eq "Dynamics SMB")) {
throw "Container $containerOrImageName is not a NAV/BC container"
}
[System.Version]$platformVersion = [System.Version]"$($inspect.Config.Labels.platform)"
if ($inspect.Config.Labels.PSObject.Properties.Name -eq 'filesonly' -and $inspect.Config.Labels.filesonly -eq 'yes') {
$tryWinRmSession = 'never'
}
if ($platformVersion.Major -lt 24) {
$usePwsh = $false
}
Expand Down

0 comments on commit f0dafc0

Please sign in to comment.