Skip to content

Fix for FormatTable remote deserialization regression - #9116

Merged
Aditya Patwardhan (adityapatwardhan) merged 11 commits into
PowerShell:masterfrom
PaulHigin:fix-runspacepool-restriction
Mar 18, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 11 commits into
PowerShell:masterfrom
PaulHigin:fix-runspacepool-restriction

Conversation

@PaulHigin

Copy link
Copy Markdown
Contributor

A recent accessibility change has caused a regression in PowerShell remoting between machines with and without the change. The change is a new RepeatHeader property added to the TableHeaderInfo class. When formatting objects are returned through the remoting channel, the client expects to see RepeatHeader property in the serialized TableHeaderInfo object and throws when it is missing.

Fix is to allow this serialized property to be null and use 'false' as the default value for the property.

Repro:

$s = New-PSSession -cn <oldVersionMachine>    # Create remote connection to machine running older version of PowerShell 5 or 6
Invoke-Command -Session $s - Script { Get-Process pwsh | Format-Table }

# Expected
# Formatted process information

# Result
# TerminatingError(out-lineoutput): "The value of the repeatHeader data member cannot be null."

PR Context

This breaks down level system remoting compatibility, and throws a terminating error whenever formatting objects are returned through the remoting layer.

PR Checklist

Co-Authored-By: PaulHigin <paulhi@microsoft.com>

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor comment.

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) changed the title [Feature] Add fix for FormatTable remote deserialization regression Fix for FormatTable remote deserialization regression Mar 12, 2019
@iSazonov Ilya (iSazonov) added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Mar 13, 2019
@PaulHigin

Copy link
Copy Markdown
Contributor Author

Aditya Patwardhan (@adityapatwardhan) Can this PR be merged?

@Amir-Mir

Copy link
Copy Markdown

Hello, so is this fixed for the PS version 5.1? Or will this be something that we will have to the Core or PS 7 to get it working? How do I patch or update my desktop so that this issue is fixed and I can continue using my scripts on PS 5.1? Thanks

@SteveL-MSFT

Copy link
Copy Markdown
Member

This was also fixed in PS v5.1 in Win 10 1903. There's a separate issue with ISE that's being fixed.

@Amir-Mir

Amir-Mir commented Oct 30, 2019 •

Copy link
Copy Markdown

This was also fixed in PS v5.1 in Win 10 1903. There's a separate issue with ISE that's being fixed.

I am currently seeing the issue in PS v5.1 running Win 10 1903 and I still see this issue.
image

Providing you with some details of my PS version and OS version.

image
image

@Amir-Mir

Copy link
Copy Markdown

This was also fixed in PS v5.1 in Win 10 1903. There's a separate issue with ISE that's being fixed.

Hello Steve Lee (@SteveL-MSFT) , you mentioned that the fix was provided in PS v5.1 in Win 1903 and I provided you with a proof that I am experiencing the same issue running the version it should be fixed in. Can you please point me in a direction where I can look up what update I need to apply to either the PS or Win to get this issue resolved?

@SteveL-MSFT

Copy link
Copy Markdown
Member

@BadSqlPro looks like this is in build 18892 or newer. You can workaround the issue by explicitly using Format-List or Format-Wide, just not Format-Table (which is default for many things unfortunately)

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants