Update ServerRemoteHost Version to be same as PSVersion (#15809)

This commit is contained in:
Steve Lee
2021-08-04 15:01:18 -07:00
committed by GitHub
parent aaaa0f2baa
commit 2ae0e4d9dd
2 changed files with 13 additions and 1 deletions
@@ -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
}
}
}