In WinRM-based remoting sessions, $PSSenderInfo.ConnectionString contains the actual connection URL used.
In SSH-based remoting sessions it seems to contain the fixed value http://localhost, which is misleading. Conversely, SSH connection information is not provided.
Steps to reproduce
Make sure that SSH-based remoting is enabled on a test machine running a Unix-like OS (see https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core)
Invoke-Command -Hostname (hostname) { $PSSenderInfo.ConnectionString } |
Should -Not -Be 'http://localhost'
Expected behavior
The test should pass.
An ssh:-based URL should be reported.
(Not sure whether one is actually used, but some meaningful representation of the SSH connection should be used.)
Actual behavior
The test fails, because fixed string http://localhost is always reported.
Expected 'http://localhost' to be different from the actual value,
but got the same value.
Environment data
PowerShell Core v7.0.0-preview.6
In WinRM-based remoting sessions,
$PSSenderInfo.ConnectionStringcontains the actual connection URL used.In SSH-based remoting sessions it seems to contain the fixed value
http://localhost, which is misleading. Conversely, SSH connection information is not provided.Steps to reproduce
Make sure that SSH-based remoting is enabled on a test machine running a Unix-like OS (see https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core)
Expected behavior
The test should pass.
An
ssh:-based URL should be reported.(Not sure whether one is actually used, but some meaningful representation of the SSH connection should be used.)
Actual behavior
The test fails, because fixed string
http://localhostis always reported.Environment data