question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
SteveL-MSFTcommented, Mar 31, 2017

@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. @JamesWTruher is working on bring up cross platform and cross PS version tests, this should catch it there.

0reactions
iSazonovcommented, Nov 14, 2017

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Version
Complete the SemanticVersion work. 4 tasks. #2983 opened by HemantMahawar. Issue-Enhancement the issue is more of a feature request than a ...
Read more >
Why is invoke-command and new-pssession not working?
1 Answer. As the error indicates, the -Session parameter accepts arguments of type PSSession - and to create such an object we need...
Read more >
How to Check the PowerShell Version Installed?
To check the PowerShell version on a remote host, use the value of the $PSVersionTable environment variable or get the information from the ......
Read more >
How to fix problems related to remote PowerShell ...
Connecting to remote server failed with the following error message: The WinRM client cannot process the request. or. The request for the ...
Read more >
about Remote Requirements - PowerShell
Describes the system requirements and configuration requirements for running remote commands in PowerShell.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found