Skip to content

Should New-PSSession using SSH accept user@hostname? #6284

Description

@SteveL-MSFT

Currently, New-PSSession has a parameter set to use -Hostname and -Username to indicate SSHTransport is being used (instead of -ComputerName and -Credential). SSH users are probably more familiar and comfortable with ssh user@hostname, so it seems we should support New-PSSession -Hostname user@hostname (unfortunately, it would be a breaking change to default to -Hostname instead of -Computername to support this as a positional parameter)

cc Paul Higinbotham (@PaulHigin) Joey Aiello (@joeyaiello)

Activity

  1. bergmeister commented on Mar 1, 2018

    @bergmeister
    Contributor

    I would rather defer this till the end of the 6.1 release cycle and focus more on actual features that add value tbh.

  2. SteveL-MSFT commented on Mar 2, 2018

    @SteveL-MSFT
    MemberAuthor

    Christoph Bergmeister (@bergmeister) this isn't marked for 6.1, although I also don't think it would be difficult to implement (split the string, pass it to the existing parameters...). This came up for me as I was using ssh to a Linux VM and then had to use new-pssession over SSH and was annoyed how easy it was using ssh

  3. markekraus commented on Mar 2, 2018

    @markekraus
    Contributor

    Steve Lee (@SteveL-MSFT) might as well use URI builder instead of split string. It would position us for possible furthe enchantments in the future.

    $Hostname = '[email protected]:8822'
    $Builder = [System.UriBuilder]::New("ssh",$Hostname)
    $Hostname = $Builder.Host
    $Username = $Builder.UserName
    $Port = $Builder.Port
    if ($Builder.Port -eq -1){
        $Port = 22
    }

    The format, after all, is a URI.

  4. added
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Mar 2, 2018
  5. removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Apr 4, 2018
  6. SteveL-MSFT commented on Apr 4, 2018

    @SteveL-MSFT
    MemberAuthor

    Was investigating a SSH MFA issue and this annoyed me enough to submit a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issuesWG-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