Skip to content

$PSSenderInfo.ConnectionString shouldn't contain 'http://localhost' in SSH-based remoting sessions. #11292

@mklement0

Description

@mklement0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions