Repository navigation
Should New-PSSession using SSH accept user@hostname? #6284
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-RemotingPSRP issues with any transport layerPSRP issues with any transport layer
Description
Activity
- addedIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-RemotingPSRP issues with any transport layerPSRP issues with any transport layer
on Mar 1, 2018 bergmeister commented
on Mar 1, 2018 ContributorMore actionsI would rather defer this till the end of the 6.1 release cycle and focus more on actual features that add value tbh.
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
sshto a Linux VM and then had to usenew-pssessionover SSH and was annoyed how easy it was usingsshSteve 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.
Reacted by Steve Lee- addedUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
on Mar 2, 2018 - removedUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
on Apr 4, 2018 Was investigating a SSH MFA issue and this annoyed me enough to submit a fix
Reacted by Ilya- addedWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesand removed
on Jul 17, 2026
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-RemotingPSRP issues with any transport layerPSRP issues with any transport layer
Currently,
New-PSSessionhas a parameter set to use-Hostnameand-Usernameto indicate SSHTransport is being used (instead of-ComputerNameand-Credential). SSH users are probably more familiar and comfortable withssh user@hostname, so it seems we should supportNew-PSSession -Hostname user@hostname(unfortunately, it would be a breaking change to default to-Hostnameinstead of-Computernameto support this as a positional parameter)cc Paul Higinbotham (@PaulHigin) Joey Aiello (@joeyaiello)