-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Revert refactoring changes that broke remoting to Windows PowerShell 5.1 #5321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ws PowerShell 5.1
lzybkr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh - it's silly that the protocol requires the names of the private fields. I suppose it's just an expedient implementation detail - just use reflection, but it's so brittle.
|
@lzybkr I agree now that I've learned how this aspect of the protocol works |
| public sealed | ||
| class ChoiceDescription | ||
| { | ||
| // DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the warning messages should say "it will break remoting compatibility with Windows PowerShell".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incomplete. To fully fix this incompatibility we need to revert field names for all encoded class/structs. Here is the supported list:
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs#L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reused an existing comment. I can update all occurrences of that comment to be more specific. Thanks for the pointer to the list of types, I'll fix those as well.
|
@SteveL-MSFT One of the commits is not linked to your github account. |
930e4ab to
0c14e56
Compare
|
@TravisEz13 fixed |
| public sealed | ||
| class ChoiceDescription | ||
| { | ||
| // DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting compatibility with Windows PowerShell compatibility with Windows PowerShell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about putting these fields within a region to make the grouping more explicit? The "Do Not Remove or Rename" region?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Will make an update.
|
@TravisEz13 can you merge? |
Call backs depend on private members to have the same name across versions of PowerShell. Specifically fixes prompts and clear.
@PaulHigin are there other callbacks I need to fix? I noticed that ctrl+c doesn't work from PSCore6 to Windows PowerShell 5.1.
Fix #4615