Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,7 +74,7 @@ public RemotingEncodingException(string message, Exception innerException, Error
/// </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);
Expand Down
11 changes: 11 additions & 0 deletions test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}