Skip to content

PowerShell crash when Invoke-Command and WinRM isn't available #4383

@SteveL-MSFT

Description

@SteveL-MSFT

New NanoServer container images don't have WinRM

docker run -it microsoft/nanoserver-insider-powershell
invoke-command -computername . -command { get-command }

Expected:
an error that winrm is required

Actual:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Management.Automation.Remoting.PrioritySendDataCollection.Clear()
   at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.CloseAsync()
   at System.Management.Automation.Remoting.Client.BaseClientTransportManager.Finalize()
Invoke-Command : Unable to load DLL 'WsmSvc.dll': The specified module could not be found. (Exception from HRESULT:
0x8007007E)
At line:1 char:1
+ Invoke-Command -ComputerName . -Command { get-command }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-Command], DllNotFoundException
    + FullyQualifiedErrorId : System.DllNotFoundException,Microsoft.PowerShell.Commands.InvokeCommandCommand

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions