I am using navcontainerhelper\Check-NavContainerHelperPermissions -Fix to use containers without requiring administrator permissions.
Currently Init-ALEnvironment and some other cmdlets are using navcontainerhelper\Get-NavContainerSession to return PowerShell session and then Invoke-Command cmdlet to invoke commands.
The problem is that Get-NavContainerSession cannot find running container when not running as administrator. You get error like this:
PS C:\Users\ernjus\Desktop\TMP-ExternalDocumentNo> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d70e2173a074 mcr.microsoft.com/businesscentral/sandbox:lt-ltsc2019 "powershell -Command…" 11 minutes ago Up 11 minutes (healthy) 80/tcp, 443/tcp, 1433/tcp, 7045-7049/tcp, 8080/tcp BCEDN
PS C:\Users\ernjus\Desktop\TMP-ExternalDocumentNo> Get-NavContainerSession -containerName BCEDN
New-PSSession : The input ContainerId d70e2173a0742457ff4609ef932fbf6ebc66fb78ecaf8766d4f2fb1d81a8f4fd does not exist, or the corresponding container is not running.
At C:\Users\ernjus\Documents\WindowsPowerShell\Modules\navcontainerhelper\0.6.0.8\ContainerHandling\Get-NavContainerSession.ps1:37 char:24
+ ... $session = New-PSSession -ContainerId $containerId -RunAsAdministrat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-PSSession], PSInvalidOperationException
+ FullyQualifiedErrorId : CreateRemoteRunspaceForContainerFailed,Microsoft.PowerShell.Commands.NewPSSessionCommand
Hi @kine,
I am using
navcontainerhelper\Check-NavContainerHelperPermissions -Fix
to use containers without requiring administrator permissions.Currently
Init-ALEnvironment
and some other cmdlets are usingnavcontainerhelper\Get-NavContainerSession
to return PowerShell session and thenInvoke-Command
cmdlet to invoke commands.The problem is that
Get-NavContainerSession
cannot find running container when not running as administrator. You get error like this:Thanks.