Skip to content

Remoting host callbacks incompatible between PowerShell 5.1 and 6.0 #4615

Closed

Description

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.

Activity

  1. added
    WG-Remoting
    Issue-Bug
    on Aug 18, 2017
  2. added this to the milestone on Aug 18, 2017
  3. PaulHigin commented on Oct 6, 2017

    @PaulHigin
    ContributorAuthor

    Another repro is to simply run the "clear" command, which makes host.UI.RawUI calls.

    PS [PowerShellCore 6.0] > Enter-PSSession-cn localhost -config microsoft.powershell
    [localhost (PowerShell 5.1)]: C:\> clear
    
    Result: null reference exception
  4. modified the milestones: , 6.0.0-RC on Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugOS-WindowsResolution-FixedWG-Remoting

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions