Skip to content

Add [Port] parameter to New-PSSession #3475

@WojtekKozaczynski

Description

@WojtekKozaczynski

This is a change request to add optional [-Port <int>] parameter to the following version of the New-PSSession commandlet

New-PSSession [-HostName] <string[]> [-Name <string[]>] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport] [-[Port <int>] [<CommonParameters>]

Use Case

The use case is opening a remote session over SSH into a Widows 10 machine. The default SSH port is 22, but if the Developer Mode is enabled on the target machine that port is already assigned to “SSH Server Broker” and “SSH Server Proxy” services installed with that mode. To make PowerShell work with OpenSSH one needs to stop those services manually, or turn the Developer Mode off, on the target machine. OpenSSH can be configured to use any open port, but the current implementation of the New-PSSession uses the default port 22.

We should have an option to instruct PowerShell to use a non-default port while creating a remote session to specific host.

Corollary

From what I see when trying to open a remote session from a Debian machine to a Windows 10 machine with “SSH Server Broker” and “SSH Server Proxy” services running, the PowerShell hangs the entire terminal session on the calling/Debian machine.

Wojtek

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions