Skip to content

Commit f0dafc0

Browse files
authored
Freddydk/filesonlyperf (#3745)
filesonly containers doesn't work with winrm sessions Fixes microsoft/AL-Go#1284 --------- Co-authored-by: freddydk <[email protected]>
1 parent 52a2b3e commit f0dafc0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ContainerHandling/Get-NavContainerSession.ps1

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ function Get-BcContainerSession {
2626
Process {
2727
$newsession = $false
2828
$session = $null
29-
[System.Version]$platformVersion = Get-BcContainerPlatformVersion -containerOrImageName $containerName
29+
$inspect = docker inspect $containerName | ConvertFrom-Json
30+
if (!($inspect.Config.Labels.psobject.Properties.Name -eq 'maintainer' -and $inspect.Config.Labels.maintainer -eq "Dynamics SMB")) {
31+
throw "Container $containerOrImageName is not a NAV/BC container"
32+
}
33+
[System.Version]$platformVersion = [System.Version]"$($inspect.Config.Labels.platform)"
34+
if ($inspect.Config.Labels.PSObject.Properties.Name -eq 'filesonly' -and $inspect.Config.Labels.filesonly -eq 'yes') {
35+
$tryWinRmSession = 'never'
36+
}
3037
if ($platformVersion.Major -lt 24) {
3138
$usePwsh = $false
3239
}

0 commit comments

Comments
 (0)