Update ServerRemoteHost
Version to be same as PSVersion
(#15809)
This commit is contained in:
parent
aaaa0f2baa
commit
2ae0e4d9dd
|
@ -4,6 +4,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Host;
|
||||
using System.Management.Automation.Internal;
|
||||
using System.Management.Automation.Remoting;
|
||||
|
@ -73,7 +74,7 @@ namespace System.Management.Automation
|
|||
/// </summary>
|
||||
internal static class RemotingConstants
|
||||
{
|
||||
internal static readonly Version HostVersion = new Version(1, 0, 0, 0);
|
||||
internal static readonly Version HostVersion = PSVersionInfo.PSVersion;
|
||||
|
||||
internal static readonly Version ProtocolVersionWin7RC = new Version(2, 0);
|
||||
internal static readonly Version ProtocolVersionWin7RTM = new Version(2, 1);
|
||||
|
|
|
@ -345,5 +345,16 @@ Describe "Remoting loopback tests" -Tags @('CI', 'RequireAdminOnWindows') {
|
|||
$result = Invoke-Command -Session $openSession -ScriptBlock { $using:number }
|
||||
$result | Should -Be 100
|
||||
}
|
||||
|
||||
It '$Host.Version should be PSVersion' {
|
||||
$session = New-RemoteSession -ConfigurationName $endPoint
|
||||
try {
|
||||
$result = Invoke-Command -Session $session -ScriptBlock { $Host.Version }
|
||||
$result | Should -Be $PSVersionTable.PSVersion
|
||||
}
|
||||
finally {
|
||||
$session | Remove-PSSession -ErrorAction Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue