Prerequisites
Steps to reproduce
There seems to be some sort of regression of #13347. I am unable to create a PSSession into a running windows container using PowerShell 7.3.3 or 7.4.0-preview1, whereas I am correctly able to do so with PowerShell 5.1.x
The command I execute is this:
New-PSSession -ContainerId <containerid> -RunAsAdministrator
New-PSSession: The input ContainerId <containerid> does not exist, or the corresponding container is not running.
This was a bug I encountered on an older version and I opened I issue and PR (13375) for (see above).
I checked the code and everything we did back then still seems to be in place, so maybe something else broke. The issue however is almost the same.
Expected behavior
A PSSessions should be created.
Actual behavior
The command fails with the message above.
Error details
Exception :
Type : System.Management.Automation.PSInvalidOperationException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The input ContainerId <id> does not exist, or the corresponding container is not running.
HResult : -2146233087
CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : InvalidOperation
TargetSite :
Name : CreateContainerProcess
DeclaringType : System.Management.Automation.Runspaces.ContainerProcess, System.Management.Automation, Version=7.3.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MemberType : Method
Module : System.Management.Automation.dll
Message : The input ContainerId <id> does not exist, or the corresponding container is not running.
Source : System.Management.Automation
HResult : -2146233079
StackTrace :
at System.Management.Automation.Runspaces.ContainerProcess.CreateContainerProcess()
at Microsoft.PowerShell.Commands.NewPSSessionCommand.CreateRunspacesWhenContainerParameterSpecified()
CategoryInfo : InvalidOperation: (:) [New-PSSession], PSInvalidOperationException
FullyQualifiedErrorId : CreateRemoteRunspaceForContainerFailed,Microsoft.PowerShell.Commands.NewPSSessionCommand
InvocationInfo :
MyCommand : New-PSSession
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 1
Line : New-PSSession -ContainerId <id> -RunAsAdministrator
PositionMessage : At line:1 char:1
+ New-PSSession -ContainerId <id> -RunAsAdminis …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : New-PSSession
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
Name Value
---- -----
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
There seems to be some sort of regression of #13347. I am unable to create a PSSession into a running windows container using PowerShell 7.3.3 or 7.4.0-preview1, whereas I am correctly able to do so with PowerShell 5.1.x
The command I execute is this:
This was a bug I encountered on an older version and I opened I issue and PR (13375) for (see above).
I checked the code and everything we did back then still seems to be in place, so maybe something else broke. The issue however is almost the same.
Expected behavior
A PSSessions should be created.Actual behavior
The command fails with the message above.Error details
Environment data
Visuals
No response