Skip to content

Clarify the limitations of type fidelity of data passed to remote commands / background jobs #5071

@mklement0

Description

@mklement0

The type fidelity of $using: values - as well as -ArgumentList arguments - is subject to limitations of the remoting serialization / deserialization infrastructure.

That is, a $using: value will only be of the same type in the target remote / background context if it is a primitive .NET type or is an instance of a handful of well-known types, as specified in the MS-PSRP (PowerShell remoting) protocol.

All other values will be method-less [pscustomobject] emulations of the original objects.

This is currently only explained in the context of receiving objects (output) via the remoting infrastructure, in the about_Remote_Output topic (section "DESERIALIZED OBJECTS") - this topic should be linked to, and vice versa - see #5075

The only exceptions are thread jobs (Start-ThreadJob and ForEach-Object -Parallel), which run in-process, where type fidelity is preserved.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageArea - PowerShell syntax and keywords

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions