Skip to content

Invoke-Command -Session $s -Command {$PSVersionTable} Fails Due to SemanticVersion #1819

Closed

Description

Steps to reproduce

  1. Install PowerShell 6.0.0-alpha.8
  2. Register its remoting endpoint
  3. Create a session to that endpoint and run Invoke-Command -Session $s -Command {$PSVersionTable}

This is another aspect of #1589 that was not fixed when addressing the original issue. The repro also shows that it works through Enter-PSSession, but not Invoke-Command.

This issue appears to be limited to the serialization & deserialization of SemanticVersion during Invoke-Command calls.

Expected behavior

The value of $PSVersionTable should be returned.

Actual behavior

PS F:\GitRepos\PowerShell> $sxs = nsn . -ConfigurationName powershell.6.0.0-alpha.8
PS F:\GitRepos\PowerShell> Invoke-Command -Session $sxs -Command {1+1}
2
PS F:\GitRepos\PowerShell> Invoke-Command -Session $sxs -Command {$psversiontable}
SemanticVersion XML tag is not recognized. Line 1, position 1046.
    + CategoryInfo          : OperationStopped: (localhost:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : JobFailure
    + PSComputerName        : localhost

PS F:\GitRepos\PowerShell> enter-pssession $sxs
[localhost]: PS C:\Users\mirichmo\Documents> $psversiontable

Name                           Value
----                           -----
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
CLRVersion
GitCommitId                    v6.0.0-alpha.8-44-ga35d6adc631309319fa9f85f142feb9b77e2b5ed
BuildVersion                   3.0.0.0
PSRemotingProtocolVersion      2.3
PSVersion                      6.0.0-alpha

Environment data

Name                           Value
----                           -----
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
CLRVersion
GitCommitId                    v6.0.0-alpha.8-44-ga35d6adc631309319fa9f85f142feb9b77e2b5ed
BuildVersion                   3.0.0.0
PSRemotingProtocolVersion      2.3
PSVersion                      6.0.0-alpha

Activity

  1. mirichmo commented on Aug 15, 2016

    @mirichmo
    MemberAuthor

    Initially reported by Aleksandar Nikolić (@alexandair) over email.

  2. added this to the milestone on Sep 29, 2016
  3. modified the milestones: 6.0.0-beta1, on Mar 30, 2017
  4. JamesWTruher commented on Mar 30, 2017

    @JamesWTruher
    Collaborator

    my real concern about this would be other types which exist in PSCore that don't exist in full - are there more of these lurking about?

  5. iSazonov commented on Mar 31, 2017

    @iSazonov
    Collaborator

    How can we catch it in our tests?

  6. SteveL-MSFT commented on Mar 31, 2017

    @SteveL-MSFT
    Member

    Ilya (@iSazonov) I don't think we can repro this on a single machine test, it needs to be across machines that have different representations of the same type. James Truher (@JamesWTruher) is working on bring up cross platform and cross PS version tests, this should catch it there.

  7. JamesWTruher commented on Mar 31, 2017

    @JamesWTruher
    Collaborator

    it can be caught on Windows as follows:
    from PSCore
    $psversiontable | export-clixml versiontable.clixml
    from Full PowerShell
    import-clixml versiontable.clixml
    -- error will happen --
    the problem isn't the remote connection, but the serializer

  8. iSazonov commented on Apr 1, 2017

    @iSazonov
    Collaborator

    James Truher (@JamesWTruher) Great!
    It looks that we can make a test in the same way as for monitoring approved aliases:
    for every build type (Win FullCRL, Win CoreCLR, Unix CoreCLR) create approvedTypes-<Build>.clixml with list of approved types and 1. trying import them in CI test time and 2. comparing with the current runtime generated (export-clixml) list.

  9. modified the milestones: , 6.0.0-beta1 on Apr 11, 2017
  10. SteveL-MSFT commented on Apr 11, 2017

    @SteveL-MSFT
    Member

    Mike Richmond (@mirichmo) this is remoting only from Windows PowerShell to PSCore6?

  11. modified the milestones: , on May 15, 2017
  12. 4 remaining items

  13. modified the milestone: on May 15, 2017
  14. changed the title [-]Invoke-Command -Session $s -Command {$PSVerionTable} Fails Due to SemanticVersion[/-] [+]Invoke-Command -Session $s -Command {$PSVersionTable} Fails Due to SemanticVersion[/+] on May 24, 2017
  15. modified the milestones: , on May 24, 2017
  16. joeyaiello commented on May 24, 2017

    @joeyaiello
    Contributor

    This is still relevant. Steve Lee (@SteveL-MSFT): yes.

  17. SteveL-MSFT commented on Nov 13, 2017

    @SteveL-MSFT
    Member

    I believe this is a change we'll have to make in Windows PowerShell 5.1

  18. iSazonov commented on Nov 14, 2017

    @iSazonov
    Collaborator

    We still haven't tests for serializer as mentioned above. I believe it is blocking issue.
    Also we merged #5037 to get SemVer 2.0 - should it be added to PS 5.1 too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backport-5.1-ConsiderConsider to backport to Windows PowerShell 5.1 due to impactResolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions