-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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.
- ID: d918461b-f625-8e6d-f43d-3197075f1c06
- Version Independent ID: 7fe490eb-b9aa-66bf-0e58-4c8400321a9c
- Content: about_Remote_Variables - PowerShell
- Content Source: reference/7/Microsoft.PowerShell.Core/About/about_Remote_Variables.md
- Product: powershell
- Technology: powershell-cmdlets
- GitHub Login: @SteveL-MSFT
- Microsoft Alias: slee