Skip to content

Remoting host callbacks incompatible between PowerShell 5.1 and 6.0 #4615

@PaulHigin

Description

@PaulHigin

This is a remoting incompatibility introduced in PowerShell 6.0. Remoting supports host callbacks to the client and the callback information includes type information and values for passed parameter arguments. For example a PromptForChoice callback passes a ChoiceDescription type argument, which includes fields "label" and "message". But PowerShell 6.0 changed the field names to "_label" and "_message". When decoding the host callback message these fields names do not exist on the client and the argument decode fails with a null reference exception:(https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs#L95).

We need to go through all supported host callbacks and ensure all types have not modified field names. There are only a few callbacks supported so this shouldn't be too bad.

Steps to reproduce

PS [PowerShellCore 6.0] > Enter-PSSession -cn localhost -config microsoft.powershell
[localhost (PowerShell 5.1)]: C:\> Install-Module Razzle

Actual behavior

Null reference exception in remote decoder when handling PromptForChoice callback.

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productOS-WindowsResolution-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